-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: Reinterpret binary data to fixed size numerical array #22840
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
nameexhaustion
merged 84 commits into
pola-rs:main
from
itamarst:add-binary-as-numerical-array
Aug 1, 2025
Merged
Changes from 77 commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
95f3b03
wip: errors, but compiles
balbok0 48ae672
works!
balbok0 9c4ec12
fix linting issues in dtype
balbok0 88e789e
Support multi-dimensional arrays
balbok0 e73c97c
remove commented out code
balbok0 432b563
lint python
balbok0 12ddfb9
clippy
balbok0 acff78e
rust lint
balbok0 e9d7fe6
ruff again
balbok0 820e44b
more clippy/ruff
balbok0 ead6777
Merge remote-tracking branch 'balbok0/add-binary-as-numerical-array' …
pythonspeed 21365e2
Reformat.
pythonspeed f6babe7
Correct to match actual behavior.
pythonspeed 643bc8d
If size is wrong, return null.
pythonspeed efdc01f
Bit packed, so not clear what it means.
pythonspeed 3b44de8
Multidimensional arrays now preserve validity.
pythonspeed ca00660
More accurate names
pythonspeed a43dca4
More tests.
pythonspeed d8a5cc2
Get rid of todo!.
pythonspeed 1d56bd3
Start with capacity.
pythonspeed 4a9bf98
Delete confusing comment.
pythonspeed 13ee4a4
Better handling and testing for things we don't support.
pythonspeed d5037f1
Lint fix.
pythonspeed 3301451
Fix typo
pythonspeed 81628bc
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed 9a94d4f
Conditional compilation.
pythonspeed 438169a
Simplify
pythonspeed d142b65
Conditional compilation.
pythonspeed 0c08b17
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed 03fe56d
Update py-polars/polars/series/binary.py
itamarst 60e9b9b
Only support one-dimensional Array.
pythonspeed ce5a9b3
Some cleanups.
pythonspeed 2a7a588
More testing
pythonspeed 99839b9
Mention destination dtype
pythonspeed 18e456f
Optimization: don't need allocations
pythonspeed 00d7cf2
Fix docstring
pythonspeed e267b72
Pacify mypy
pythonspeed 7409bd4
Get rid of byte_size().
pythonspeed 78216c7
Bit more testing.
pythonspeed dc68c2d
remove get_shape() allocation
nameexhaustion 616eb3f
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed 05b3817
Add type checking on conversion to IR.
pythonspeed 9aae0d0
Minimize the error checking, since user facing was done already
pythonspeed 4cbfbf6
Nit from review comment
pythonspeed b3c7cd8
Docs
pythonspeed 741cffa
Document the issues with a potential fast path.
pythonspeed a108baf
Better name.
pythonspeed 2067a17
Support reinterpreting to non-primitive types that map to primitive n…
pythonspeed 842802f
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed f9da0e8
Rename to match new name.
pythonspeed e2278b2
Pacify mypy
pythonspeed d860f1f
Simplify, and improve the error message
pythonspeed 66d0f31
Reformat
pythonspeed 865b2b5
Document the change.
pythonspeed 138c49c
Correct verb
pythonspeed 006b79f
Document in both locations and try to pacify ruff.
pythonspeed 74fe457
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed a77a001
Fix cargo fmt
pythonspeed 502cc66
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed 5c9cc5f
Change the argument so there is less duplication.
pythonspeed d983de2
Switch to a Vec-based implementation.
pythonspeed 760864c
Some optimizations, hopefully.
pythonspeed 9d34386
Tweak from clippy
pythonspeed e7c8d80
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed cabd0f2
Merge remote-tracking branch 'origin/main' into add-binary-as-numeric…
pythonspeed b2b51fb
Get rid of function pointers (even if the compiler optimizes them away).
pythonspeed c64280d
Optimized fast path for little endian data on little endian CPUs.
pythonspeed 989c351
Another optimization.
pythonspeed 766872a
Less data type conversion.
pythonspeed 1815625
Rename the variable.
pythonspeed 88ff748
More informative error.
pythonspeed 0d37de8
Match type-checking logic in the underlying operation, more accurate …
pythonspeed 0994bd5
Reformat.
pythonspeed 586817c
Fix typo.
pythonspeed 3f3ad44
Ruff doesn't link perfectly reasonable unicode characters.
pythonspeed eaba025
Make sure the sizes aren't too big.
pythonspeed 1b32a87
Don't limit to IdxSize.
pythonspeed c6572fc
Better name.
pythonspeed 1db40b0
More safety checks, remove possibility of uninitialized memory.
pythonspeed 482858a
Handle edge case where the length of binary data is zero.
pythonspeed 596209e
Another test.
pythonspeed 244aae3
Pacify clippy.
pythonspeed 7781235
Slightly clearer assert.
pythonspeed 8377805
Minor cleanups.
pythonspeed 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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.