-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Fixed metadata propagation in Dataframe.any #52922
Conversation
Looks like there's some typing failures |
Propogate only when it is Series and ignore the return-value typing error when it is bool |
pandas/core/frame.py
Outdated
"any", nanops.nanany, axis, bool_only, skipna, **kwargs | ||
) | ||
if isinstance(result, (np.bool_, bool)): | ||
return result # type: ignore[return-value] |
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.
Could add bool | np.bool__
to the return types (but then you might need to add ignores elsewhere in pandas where any()
is called)
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.
Thank you for your suggestion, let me try
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.
You probably need to add ignores here:
pandas/core/reshape/encoding.py:458: error: Item "bool" of "Union[Series, bool_, bool]" has no attribute "any" [union-attr]
pandas/core/reshape/encoding.py:461: error: Item "bool_" of "Union[Series, bool_, bool]" has no attribute "idxmax" [union-attr]
pandas/core/reshape/encoding.py:461: error: Item "bool" of "Union[Series, bool_, bool]" has no attribute "idxmax" [union-attr]
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.The goal here is to make progress on Various methods don't call call __finalize__ #28283.