-
-
Notifications
You must be signed in to change notification settings - Fork 750
Use pickle protocol 5 with NumPy object arrays #3871
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
mrocklin
merged 8 commits into
dask:master
from
jakirkham:use_pickle_protocol_5_numpy_object_array
Jun 9, 2020
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d3c1d62
Test pickle serialization with NumPy object arrays
jakirkham 77427ef
Test equality after checking array strides
jakirkham 6529237
Check array shape and type as well
jakirkham 9e82ce1
Handle object array tests specially
jakirkham 3759929
Test pickling a ragged NumPy array
jakirkham 1487612
Use pickle protocol 5 with NumPy object arrays
jakirkham 406dd3b
Assert ragged array components extracted as frames
jakirkham e07d26b
Assert additional frames when pickling
jakirkham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we converting into a
memoryviewhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
buffer_callbackis called on values of typePickleBuffer. Here's an example:Though
PickleBufferis a wrapper that expects to be passed somebytes-like object, which it wraps zero-copy. In the example above these are the nested NumPy arrays.However as the rest of the serialization code expects frames to be
bytesormemoryviews. We would either need to retool it to supportPickleBuffer(with special casing when it is not available) or we can simply convert it to amemoryview, which is also zero-copy.We've gone for the latter path of converting to a
memoryviewsimilar to what was done in PR ( #3784 ). Note this is done without loss of generality.