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_partitions are properly pickled #238

Merged

Conversation

TomAugspurger
Copy link
Contributor

Closes #237

Comment on lines +115 to +116
*dask_state, spatial_partitions = state
super().__setstate__(dask_state)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially, I just copied over the __setstate__ from dask.dataframe and added our state. By doing it like this (calling into super()) dask_geopandas should continue to work if Dask adds additional attributes to its state.

Copy link
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

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

This looks super reasonable to me and I really appreciate the attention to future compatibility.

Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

Thanks! @TomAugspurger does this block anything on your side? We can potentially cut 0.3.1.

@martinfleis martinfleis merged commit 474c6c3 into geopandas:main Mar 6, 2023
@TomAugspurger
Copy link
Contributor Author

Thanks! No, I'm able to work around it so it isn't blocking anything for me.

@TomAugspurger TomAugspurger deleted the tom/fix/pickle-spatial-partitions branch March 6, 2023 14:52
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.

Pickling DaskGeoDataFrame loses spatial_partitions
3 participants