-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: unwrap setitem indexer for ArrowExtensionArray #50085
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
mroeschke
merged 11 commits into
pandas-dev:main
from
lukemanley:ea-unwrap-setitem-indexer
Jan 4, 2023
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ee3062e
unwrap setitem indexer for 1D-only extension arrays
lukemanley 98d91b8
fix test
lukemanley 458a3d4
gh refs
lukemanley 8b07ef2
fix whatsnew
lukemanley 52d1e2b
update test
lukemanley f895749
move fix to ArrowExtensionArray.__setitem__
lukemanley 6b3c4df
remove typing
lukemanley 3203d3f
Merge remote-tracking branch 'upstream/main' into ea-unwrap-setitem-i…
lukemanley df4f3cb
Merge remote-tracking branch 'upstream/main' into ea-unwrap-setitem-i…
lukemanley 981bdff
remove typing override
lukemanley 3ac6a93
Merge remote-tracking branch 'upstream/main' into ea-unwrap-setitem-i…
lukemanley 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.
Not sure, but it might make more sense to handle this in setitem of the ArrowExtensionArray?
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 50/50 on whether to put it here or in ArrowExtensionArray.setitem. I ended up leaning towards this as it seems consistent with this method and may be helpful beyond ArrowExtensionArray (e.g. third-party EAs). But happy to move it if setitem is a better place for it.
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 am more concerned with our setiteim for Arrow diverging from the numpy setitem call, but not sure if this is correct either.
cc @jbrockmendel Could you weigh in here?
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.
id want to handle it correctly in the ArrowArray method. could add a test to the extension base tests for handling this case correctly
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.
ok, I will change this to be handled within
ArrowExtensionArray.__setitem__
.I guess the typing on
ExtensionArray.__setitem__
andArrowExtensionArray.__setitem__
should change as well?pandas/pandas/core/arrays/base.py
Line 351 in 1488157
pandas/pandas/core/arrays/arrow/array.py
Line 878 in 1488157
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.
Yeah would make sense