We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0596b51 commit 8f012c4Copy full SHA for 8f012c4
ibis/backends/duckdb/registry.py
@@ -6,7 +6,6 @@
6
7
import numpy as np
8
import sqlalchemy as sa
9
-from geoalchemy2 import Geometry
10
from sqlalchemy.ext.compiler import compiles
11
from sqlalchemy.sql.functions import GenericFunction
12
@@ -29,6 +28,18 @@
29
28
)
30
from ibis.common.exceptions import UnsupportedOperationError
31
+try:
32
+ from geoalchemy2 import Geometry
33
+
34
+ class Geometry_WKB(Geometry):
35
+ as_binary = "ST_AsWKB"
36
37
+except ImportError:
38
39
+ class Geometry_WKB:
40
+ ...
41
42
43
if TYPE_CHECKING:
44
from collections.abc import Mapping
45
@@ -56,10 +67,6 @@ def _round(t, op):
56
67
}
57
68
58
69
59
-class Geometry_WKB(Geometry):
60
- as_binary = "ST_AsWKB"
61
-
62
63
70
def _centroid(t, op):
64
71
arg = t.translate(op.arg)
65
72
return sa.func.st_centroid(arg, type_=Geometry_WKB)
0 commit comments