Skip to content

type annotation for Index/MultiIndex.names is incorrect #804

Open
@tswast

Description

@tswast

Describe the bug

type annotation for Index/MultiIndex.names is incorrect

To Reproduce

  1. 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])
  1. Indicate which type checker you are using (mypy or pyright).

mypy

  1. 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

No one assigned

    Labels

    BlockedRequires external dependency before progressingIndexRelated to the Index class or subclassesgood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions