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

Ensure spatial index _sindex is retained on dataframe copy #1122

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Ensure spatial index _sindex is retained on dataframe copy #1122

merged 1 commit into from
Sep 26, 2022

Conversation

ianthomas23
Copy link
Member

Fixes #1121.

The fix is to copy the _sindex if it is not copied automatically when we slice a DataFrame. We should probably consider this a temporary solution as the full solution would occur in spatialpandas, but with possible changes due to use of awkward-pandas we should hold off on that for the moment.

It wasn't possible to directly access the problem code as it occurred within a bypixel call. So I have pulled out the conversion code into a _bypixel_sanitise function which is tested on its own in the new test_spatial_index_not_dropped test.

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a reasonable approach, thanks.

@ianthomas23 ianthomas23 merged commit a1de2d5 into holoviz:master Sep 26, 2022
@ianthomas23 ianthomas23 deleted the 1121_spatial_index_dropped branch September 26, 2022 14:28
@ianthomas23 ianthomas23 added this to the v0.14.3 milestone Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datashader discards spatialpandas spatial indexer
2 participants