-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: fix a few errors found by pandas-stub #47562
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
Conversation
pandas/core/indexes/multi.py
Outdated
cls, | ||
iterables: Sequence[Iterable[Hashable]], | ||
sortorder: int | None = None, | ||
names: Sequence[str | None] | lib.NoDefault = lib.no_default, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think names: Sequence[Level | None] | lib.NoDefault
or similar as the docstring is under-specifying what can be accepted here (more than just strings)
In [1]: >>> numbers = [0, 1, 2]
...: >>> colors = ['green', 'purple']
...: >>> pd.MultiIndex.from_product([numbers, colors],
...: ... names=[55, 60])
Out[1]:
MultiIndex([(0, 'green'),
(0, 'purple'),
(1, 'green'),
(1, 'purple'),
(2, 'green'),
(2, 'purple')],
names=[55, 60])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing all of the typing PRs!
thanks @twoertwein |
There are (unsurprisingly) many errors when trying to use pyright/mypy to validate pandas-stub's tests against the pandas annotations. This PR fixes three of them.