-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: ArrowExtensionArray._cmp_method to return pyarrow.bool_ type #51643
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
API: ArrowExtensionArray._cmp_method to return pyarrow.bool_ type #51643
Conversation
asv_bench/asv.conf.json
Outdated
@@ -126,6 +126,6 @@ | |||
}, | |||
"build_command": | |||
["python -m pip install versioneer[toml]", | |||
"python setup.py build -j4", | |||
"python setup.py build -j1", |
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.
Looks like this is failing asvs?
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've reverted this. The asv job was failing before I tried this change. This was just an attempt to find the issue.
pandas/core/arrays/arrow/array.py
Outdated
"and_": pc.and_kleene, | ||
"rand_": lambda x, y: pc.and_kleene(y, x), | ||
"or_": pc.or_kleene, | ||
"ror_": lambda x, y: pc.or_kleene(y, x), | ||
"xor": pc.xor, |
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(?) the first four here should have underscores. These were raising in an ASV.
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.
for example, this raises on main:
import pandas as pd
s1 = pd.Series([True], dtype="boolean[pyarrow]")
s2 = pd.Series([False], dtype="boolean[pyarrow]")
# raises: KeyError: 'or_'
s1 | s2
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.
Good find! Could you move into a separate pr and add tests?
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.
sure, will do
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.
opened #51688 for this
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 min versions failure looks legit?
yep. just pushed a fix. I think the failure is related to the It looks like that test combined with the deepcopy was hitting this bug in older versions of numpy: numpy/numpy#21883 I think this will work now. What is the reason to use deepcopy instead of
|
@mroeschke argued back then that this would cover eas without a copy method, but if this is slow, then I'd say we can switch to copy |
Fine to switch to |
Thanks @lukemanley |
@mroeschke thoughts on back porting? This would fix #51980 |
Sure, +1 to backport |
@meeseeksdev backport 2.0.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…ndas-dev#51643) * API: ArrowExtensionArray._cmp_method to return pyarrow.bool_ type * whatsnew * try removing asv parallel build * fix logical func keys * cleanup * fix test * subclass ExtensionArraySupportsAnyAll
…hod to return pyarrow.bool_ type) (#51987) * API: ArrowExtensionArray._cmp_method to return pyarrow.bool_ type (#51643) * API: ArrowExtensionArray._cmp_method to return pyarrow.bool_ type * whatsnew * try removing asv parallel build * fix logical func keys * cleanup * fix test * subclass ExtensionArraySupportsAnyAll * Add whatsnew --------- Co-authored-by: Luke Manley <[email protected]>
doc/source/whatsnew/v2.1.0.rst
file if fixing a bug or adding a new feature.Per #51462 (comment), updating
ArrowExtensionArray._cmp_method
to returnboolean[pyarrow]
dtype instead ofboolean
.