Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Sep 3, 2024
1 parent acc7fa3 commit b95269b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/test_duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def test_create_table_as_custom_con():


def test_geometry_only_column():
# https://github.com/developmentseed/lonboard/issues/622
con = duckdb.connect()
sql = f"""
INSTALL spatial;
Expand All @@ -222,3 +221,20 @@ def test_geometry_only_column():

m = viz(con.table("data"), con=con)
assert isinstance(m.layers[0], ScatterplotLayer)


def test_geometry_only_column_type_geometry():
# For WKB parsing
pytest.importorskip("shapely")

# https://github.com/developmentseed/lonboard/issues/622
con = duckdb.connect()
sql = f"""
INSTALL spatial;
LOAD spatial;
SELECT geom FROM ST_Read("{cities_gdal_path}");
"""
query = con.sql(sql)

# Should create layer without erroring
_layer = ScatterplotLayer.from_duckdb(query, con)

0 comments on commit b95269b

Please sign in to comment.