Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(geospatial): accept geopandas GDFs in memtable #10485

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

gforsyth
Copy link
Member

Description of changes

Passing a geopandas.GeoDataFrame directly to memtable will yield a bunch of
errors because our various to_arrow and other proxy methods don't know how to
handle the bundled geo data.

As an intermediate bit of functionality until things like geoarrow are more
widely supported, this PR adds an extra dispatch to the memtable constructor
to cast geometry columns to WKB, which allows most backends to ingest the
resulting data with the geo columns as binary, which can then be cast to
geometry columns in backends that support that.

Issues closed

Resolves #10453

@github-actions github-actions bot added the tests Issues or PRs related to tests label Nov 13, 2024
ibis/expr/api.py Outdated Show resolved Hide resolved
@cpcloud cpcloud added this to the 10.0 milestone Nov 13, 2024
@cpcloud cpcloud added feature Features or general enhancements geospatial Geospatial related functionality datatypes Issues relating to ibis's datatypes (under `ibis.expr.datatypes`) ecosystem External projects or activities labels Nov 13, 2024
@cpcloud
Copy link
Member

cpcloud commented Nov 13, 2024

Definitely feels like a thing that should have explicit support in duckdb/duckdb_geospatial

@cpcloud cpcloud merged commit 56ec371 into ibis-project:main Nov 13, 2024
83 checks passed
@cpcloud
Copy link
Member

cpcloud commented Nov 13, 2024

Thanks @gforsyth!

@gforsyth gforsyth deleted the geo_memtable branch November 18, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datatypes Issues relating to ibis's datatypes (under `ibis.expr.datatypes`) ecosystem External projects or activities feature Features or general enhancements geospatial Geospatial related functionality tests Issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: create_table() fails on geopandas
2 participants