Skip to content

Commit 605ec5a

Browse files
fix: move duckdb imports to inside function (#813)
to avoid duckdb becoming a hard dependency ## What I am changing / How I did it move import to inside function ## How you can test it might trigger a ruff rule around imports not at top of file ## Related Issues closes #810 (or alternatively, duckdb should explicitly become a hard dependency)
1 parent 5dba08f commit 605ec5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lonboard/_geoarrow/_duckdb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
list_array,
1515
struct_field,
1616
)
17-
from duckdb import ColumnExpression, FunctionExpression
1817

1918
from lonboard._constants import EXTENSION_NAME
2019

@@ -101,6 +100,8 @@ def _from_geometry(
101100
geom_col_idx: int,
102101
crs: str | pyproj.CRS | None = None,
103102
) -> Table:
103+
from duckdb import ColumnExpression, FunctionExpression
104+
104105
other_col_names = [name for i, name in enumerate(rel.columns) if i != geom_col_idx]
105106
if other_col_names:
106107
non_geo_table = Table.from_arrow(rel.select(*other_col_names).arrow())

0 commit comments

Comments
 (0)