-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: teach PyArray to compare #1090
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2c5672a
feat: teach PyArray to compare
danking ca3efd4
fix docs
danking b8704bb
use the operators, move docs into the class docs
danking ea57488
Merge remote-tracking branch 'origin/develop' into dk/pyvortex-compare
danking 94bffc7
remove duplicate inputs from merge cruft
danking 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 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.
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.
I think this is a very weird python api, would this be better as a individual funtions instead of string switch?
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.
I agree it is weird. PyArrow doesn't implement lt and friends but, AFAICT, nobody has complained on their issues about it. They do implement
__eq__
. In the compute functions API, they do providegreater
and friends.My best guess is that those operations are allocating so they make them available through an API that exposes the memory pool parameter. It seems like that's a way to use jemalloc or mimalloc for Arrow arrays even if the rest of the application uses some other allocator. It seems like that could be used to create an Arena for arrow arrays and do O(1) free after, say, processing a chunk of data.
Anyway, I think you're right that we should implement the operators. Even if we later provide a way to specify an allocator, the operators can continue to use the default allocator.
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.
I was mostly even thinking that even if it's not the
__eq__
or__compare__
I think it's better to get rid of stringly typed operator. FWIW the C api takes an int for operatorThere 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.
I switched to operators and moved the docs into the examples for technical reasons (see comment).