Open
Description
Describe the bug
type annotation for Index/MultiIndex.names is incorrect
To Reproduce
- Provide a minimal runnable
pandas
example that is not properly checked by the stubs.
In [1]: import pandas as pd
In [2]: df = pd.DataFrame({"a": ["a", "b", "c"], "i": [10, 11, 12]}, index=pd.Index([5, 10, 15], name="idx"))
In [4]: df.index.names
Out[4]: FrozenList(['idx'])
In [5]: df.index.names = (None,)
In [6]: df.index.names
Out[6]: FrozenList([None])
- Indicate which type checker you are using (
mypy
orpyright
).
mypy
- Show the error message received from that type checker while checking your example.
bigframes/core/blocks.py:436: error: Incompatible types in assignment (expression has type "tuple[None]", variable has type "list[str]") [assignment]
Please complete the following information:
- OS: [e.g. Windows, Linux, MacOS] Linux
- OS Version [e.g. 22]
Distributor ID: Debian
Description: Debian GNU/Linux rodete
Release: n/a
Codename: rodete
- python version Python 3.10.9
- version of type checker mypy==1.5.1
- version of installed
pandas-stubs
pandas-stubs==2.0.3.230814
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Requires external dependency before progressingRequires external dependency before progressingRelated to the Index class or subclassesRelated to the Index class or subclasses