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

Model setstate shim #216

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Model setstate shim #216

merged 2 commits into from
Oct 29, 2024

Conversation

bmaranville
Copy link
Member

Add a shim in Stack.__setstate__ to handle models that were pickled when there was a custom __getstate__ on that class (prior to v1.0.0a6).

The custom state object is a tuple, which allows it to be easily distinguished from the default state object which is a dict.

Since the custom __getstate__ remains removed, models that are re-pickled (or dilled) after this will have the standard dict state representation, that can be unpickled later after this shim __setstate__ is removed.

TODO: we can remove the __setstate__ completely at some point in the future.

…oved from Stack

Also remove custom __getstate__ from Repeat, and add shim to __setstate__ there as well
@bmaranville bmaranville merged commit 327d386 into master Oct 29, 2024
10 checks passed
@bmaranville bmaranville deleted the model-setstate-shim branch November 8, 2024 19:58
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.

2 participants