We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Prior to #282, pd.IndexSlice returned a tuple with specific types. That is no longer the case.
pd.IndexSlice
To Reproduce
import pandas as pd df = ( pd.DataFrame({"x": [1, 2, 2, 3, 4], "y": [10, 20, 30, 40, 10]}) .assign(z=lambda df: df.x * df.y) .set_index(["x", "y"]) ) ind = pd.Index([2, 3]) reveal_type(pd.IndexSlice[ind, :])
With pandas-stubs 1.4.4.220911, we get:
pyright reports:
isli.py:4:13 - information: Type of "pd.IndexSlice[ind, :]" is "tuple[Unknown, ...]"
mypy reports:
isli.py:4: note: Revealed type is "builtins.tuple[Any, ...]"
With pandas-stubs 1.4.4.220906, we get:
pyright:
isli.py:9:13 - information: Type of "pd.IndexSlice[ind, :]" is "tuple[str | str_ | bytes | date | datetime | timedelta | bool | complex | Timestamp | Timedelta | slice, ...]"
mypy:
isli.py:9: note: Revealed type is "builtins.tuple[Union[Union[builtins.str, numpy.str_], Union[builtins.str, builtins.bytes, datetime.date, datetime.datetime, datetime.timedelta, builtins.bool, builtins.complex, pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timedeltas.Timedelta], builtins.slice], ...]"
Please complete the following information:
pandas-stubs
Additional context
@bashtage needs to look at this, because change in #282 is what messed this up.
The text was updated successfully, but these errors were encountered:
bashtage
Successfully merging a pull request may close this issue.
Describe the bug
Prior to #282,
pd.IndexSlice
returned a tuple with specific types. That is no longer the case.To Reproduce
With pandas-stubs 1.4.4.220911, we get:
pyright reports:
mypy reports:
With pandas-stubs 1.4.4.220906, we get:
pyright:
mypy:
Please complete the following information:
pandas-stubs
: 1.4.4.220911Additional context
@bashtage needs to look at this, because change in #282 is what messed this up.
The text was updated successfully, but these errors were encountered: