Repository navigation
Patch cloudpickle to not reset dynamic class each time it is unpickled - #7388
Merged
Merged
Conversation
stuartarchibald
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the patch, a couple of minor things to resolve else looks good.
|
|
||
|
|
||
|
|
||
| class TestCloudPickleIssues(TestCase): |
Contributor
There was a problem hiding this comment.
Maybe this ought to also include the original reproducer as a test? #7356 (comment)
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
stuartarchibald
approved these changes
Sep 21, 2021
stuartarchibald
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the patch and fixes.
sklam
added a commit
to sklam/numba
that referenced
this pull request
Sep 22, 2021
Patch cloudpickle to not reset dynamic class each time it is unpickled
sklam
added a commit
to sklam/numba
that referenced
this pull request
Oct 27, 2022
sklam
added a commit
to sklam/numba
that referenced
this pull request
Nov 29, 2023
swap357
added a commit
to swap357/numba
that referenced
this pull request
Jul 15, 2025
swap357
added a commit
to swap357/numba
that referenced
this pull request
Jul 15, 2025
* upgrade cloudpickle to 3.1.1 * Adapt patch from numba#7388 to address dynamic class state reset issue numba#7356
esc
added a commit
to esc/numba
that referenced
this pull request
Jul 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a problem with cloudpickle when dynamic class is unpickled and the class is reset to the state when it is pickled.
A short reproducer for the cloudpickle problem is available here:
Note, cloudpickle treats any class created in
__main__as dynamic.The patch makes cloudpickle remember whether a dynamic class is being reused. Reuse can come from the class being unpickled in the same process as it being pickled; or, a previously unpickled class is still around.
Reference an existing issue
Fixes #7356