-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Allow plain bools in ExtensionArray.equals #34661
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
Conversation
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.
Thanks, looks good to me!
@@ -29,6 +29,10 @@ def data_missing(): | |||
return ArrowBoolArray.from_scalars([None, True]) | |||
|
|||
|
|||
def test_basic_equals(data): | |||
assert pd.Series(data).equals(pd.Series(data)) |
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.
There is a BaseMethodsTests
test_equals
that could in theory be reused here. But since none of the other methods are implemented, we would need to skip all other tests, which would be a bit onerous. So fine with a custom test.
Co-authored-by: Joris Van den Bossche <[email protected]>
pandas/core/arrays/base.py
Outdated
return (equal_values | equal_na).all().item() | ||
result = (equal_values | equal_na).all() | ||
|
||
if isinstance(result, np.bool_): |
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.
bool(result)
should work
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.
Addressed and CI passed.
Thanks! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff