Skip to content

BUG: pickling ArrowExtensionArray with _pa_data rename #52027

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

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added IO Pickle read_pickle, to_pickle Arrow pyarrow functionality labels Mar 16, 2023
@mroeschke mroeschke added this to the 2.1 milestone Mar 16, 2023
@mroeschke mroeschke requested a review from phofl March 16, 2023 18:47
Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

return state

def __setstate__(self, state) -> None:
state["_pa_array"] = pa.chunked_array(state["_data"])
if "_data" in state:
data = state["_data"]
Copy link
Member

Choose a reason for hiding this comment

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

i think pop it here to avoid including it in __dict__.update below?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good call. Thanks!

@phofl phofl merged commit 23c3dc2 into pandas-dev:main Mar 16, 2023
@phofl
Copy link
Member

phofl commented Mar 16, 2023

thx @mroeschke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality IO Pickle read_pickle, to_pickle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants