-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF/PERF: ArrowExtensionArray.__setitem__ #50632
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
Changes from all commits
cac4c2a
91049c3
e01e6e1
a205bf7
851704f
1c97e75
833baa6
3c31f1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,7 +172,6 @@ def test_setitem(multiple_chunks, key, value, expected): | |
|
||
result[key] = value | ||
tm.assert_equal(result, expected) | ||
assert result._data.num_chunks == expected._data.num_chunks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this no longer holds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing implementation iterated through the chunks and set values chunk by chunk. This implementation passes the entire There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally I think we should try to maintain the chunking layout as much as possible, but it's more of an implementation detail and if the pyarrow compute functions don't necessarily maintain the chunking layout I suppose this is fine |
||
|
||
|
||
@skip_if_no_pyarrow | ||
|
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.
Are we guaranteed here that
self._data.type
matchesself.dtype.pyarrow_dtype
?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.
Yes, I believe so. I addressed the TODO in
ArrowExtensionArray._maybe_convert_setitem_value
so that it now boxes the setitem values will raise if the replacement values cannot be cast to the original self._data.type.