Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

jiawei-zhang-a
Copy link
Contributor

@jiawei-zhang-a jiawei-zhang-a commented Apr 26, 2023

@mroeschke
Copy link
Member

Looks like there's some typing failures

@mroeschke mroeschke added the metadata _metadata, .attrs label Apr 26, 2023
@jiawei-zhang-a jiawei-zhang-a changed the title Fixed metadata propagation in Dataframe.add Fixed metadata propagation in Dataframe.any Apr 26, 2023
@jiawei-zhang-a
Copy link
Contributor Author

Propogate only when it is Series and ignore the return-value typing error when it is bool

"any", nanops.nanany, axis, bool_only, skipna, **kwargs
)
if isinstance(result, (np.bool_, bool)):
return result # type: ignore[return-value]
Copy link
Member

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)

Copy link
Contributor Author

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

Copy link
Member

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]

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

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.

@github-actions github-actions bot added the Stale label Jun 7, 2023
@mroeschke
Copy link
Member

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.

@mroeschke mroeschke closed this Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata _metadata, .attrs Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants