Skip to content

TYPING: keywords in df.sort_values and sr.sort_values cannot be annotated #30451

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

Closed
charlesdong1991 opened this issue Dec 24, 2019 · 3 comments
Closed
Labels
Closing Candidate May be closeable, needs more eyeballs Typing type annotations, mypy/pyright type checking

Comments

@charlesdong1991
Copy link
Member

Observed in the PR #30402 and PR #27237

Annotation seems not to be able to added for sort_values. If added, error message will pop up in CI:

pandas/core/series.py:2691: error: Signature of "sort_values" incompatible with supertype "NDFrame"
pandas/core/frame.py:4701: error: Signature of "sort_values" incompatible with supertype "NDFrame"
@jbrockmendel
Copy link
Member

To make the signatures match, by would need to be added to Series.sort_values

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Dec 28, 2019
@jacobaustin123
Copy link
Contributor

by would need to be added to Series.sort_values (as the first argument, so API breaking) and we would need to remove the default by=None argument in NDFrame.sort_values in generic.py.

@jbrockmendel
Copy link
Member

These now have types, though there is a "type: ignore" on the DataFrame method. Closable?

@jbrockmendel jbrockmendel added the Closing Candidate May be closeable, needs more eyeballs label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closing Candidate May be closeable, needs more eyeballs Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

No branches or pull requests

5 participants