Skip to content

TYP: annotate index/columns as Index #51819

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
jbrockmendel opened this issue Mar 7, 2023 · 1 comment
Closed

TYP: annotate index/columns as Index #51819

jbrockmendel opened this issue Mar 7, 2023 · 1 comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Mar 7, 2023

Series defined index and DataFrame defines index and columns as AxisProperty objects, which are property-like. These are not annotated as giving Index objects when accessed. I found in #51813 then when just adding index: Index to a mixin it caused 400ish mypy complaints elsewhere. The same thing happens if i add index: Index in NDFrame.

So it'd be nice if we can find a way to type AxisProperty.__get__ as returning an Index.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 7, 2023
@jbrockmendel
Copy link
Member Author

OK looks like AxisProperty.__get__ is already annotated. Not sure there is more we can do here. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

1 participant