Skip to content

Commit

Permalink
chore: apply review suggestions
Browse files Browse the repository at this point in the history
chore: skip import geoalchemy
  • Loading branch information
ncclementi committed Nov 30, 2023
1 parent b7279e5 commit d6195a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ibis/backends/duckdb/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
reduction,
try_cast,
)
from ibis.backends.duckdb.datatypes import Geometry_WKB
from ibis.backends.postgres.registry import (
_array_index,
_array_slice,
Expand All @@ -28,7 +29,6 @@
)
from ibis.common.exceptions import UnsupportedOperationError

from ibis.backends.duckdb.datatypes import Geometry_WKB
if TYPE_CHECKING:
from collections.abc import Mapping

Expand Down
9 changes: 8 additions & 1 deletion ibis/backends/duckdb/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ def test_read_parquet(data_dir):
assert t.count().execute()


@pytest.mark.xfail(
LINUX and SANDBOXED,
reason="nix on linux cannot download duckdb extensions or data due to sandboxing",
)
def test_load_spatial_when_geo_column(tmpdir):
# create a table with a geom column
pytest.importorskip("geoalchemy2")

# create a table with a geom column
path = str(tmpdir.join("test_load_spatial.ddb"))

con_db = duckdb.connect(path)
Expand Down Expand Up @@ -100,6 +105,8 @@ def test_read_geo_to_geopandas(con, data_dir):
t = con.read_geo(data_dir / "geojson" / "zones.geojson")
gdf = t.head().to_pandas()
assert isinstance(gdf, gpd.GeoDataFrame)


@pytest.mark.xfail_version(
duckdb=["duckdb<0.7.0"], reason="read_json_auto doesn't exist", raises=exc.IbisError
)
Expand Down

0 comments on commit d6195a7

Please sign in to comment.