Skip to content

GH828 Replace Iterable with Axes for Index.__new__/Index.__init__ #1202

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

Merged
merged 4 commits into from
Apr 27, 2025

Conversation

loicdiridollou
Copy link
Member

Comment on lines 1328 to 1332
pd.DatetimeIndex(
{ # type: ignore[arg-type]
"Jan. 1, 2008": "New Year’s Day" # pyright: ignore[reportArgumentType]
}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should work and passing a dict should be acceptable. You have to look at the subclasses of Index (like DatetimeIndex) and modify the __init__() or __new__() methods in those subclasses to accept Axes.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

@Dr-Irv Dr-Irv merged commit de6b744 into pandas-dev:main Apr 27, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Argument 1 to "DatetimeIndex" has incompatible type "dict[str, str]"
2 participants