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

TYP: Typing improvements for Index #59105

Merged
merged 4 commits into from
Jul 21, 2024

Conversation

AndreyKolomiets
Copy link
Contributor

  • Added type annotations to new arguments/methods/functions.
    Add axis to Index.repeat
    Add sort to Index.union
    Add sort to Index.difference
    Add sort and result_name to Index.symmetric_difference
    Add level to Index.isin
    Add start, end, step to Index.slice_locs
    Add loc to Index.delete
    Add axis to Index.argmin
    Add axis to Index.argmax
    Add axis to Index.min
    Add axis to Index.max
    Add dtype to Index.astype

@AndreyKolomiets
Copy link
Contributor Author

Note: I've discussed this error with @phofl at pydata meetup. He told me that this error could likely be ignored, probably some pyright issue

@AndreyKolomiets
Copy link
Contributor Author

Seems like pyright meant numpy.integer by "integer". Now everything is passed @phofl

@mroeschke mroeschke requested a review from twoertwein July 16, 2024 16:46
@mroeschke mroeschke added the Typing type annotations, mypy/pyright type checking label Jul 16, 2024
Copy link
Member

@twoertwein twoertwein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, you can also add some of these changes to pandas-stubs.

@Dr-Irv

pandas/core/indexes/base.py Outdated Show resolved Hide resolved
pandas/core/indexes/base.py Show resolved Hide resolved
pandas/core/indexes/base.py Outdated Show resolved Hide resolved
pandas/core/indexes/base.py Outdated Show resolved Hide resolved
pandas/core/indexes/base.py Outdated Show resolved Hide resolved
pandas/core/indexes/base.py Outdated Show resolved Hide resolved
@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jul 16, 2024

If you want, you can also add some of these changes to pandas-stubs.

@Dr-Irv

Yes, a PR in pandas-stubs would be welcome. Some of these methods are already done there, others need updates similar to what is in this PR.

@AndreyKolomiets AndreyKolomiets requested a review from Dr-Irv as a code owner July 19, 2024 20:49
@twoertwein twoertwein merged commit 080add1 into pandas-dev:main Jul 21, 2024
45 checks passed
@twoertwein
Copy link
Member

Thank you @AndreyKolomiets !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants