-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
jorisvandenbossche
left a comment
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!
|
|
||
|
|
||
| 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 pandasgit diff upstream/master -u -- "*.py" | flake8 --diff