-
-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
Describe the bug
Currently MultiIndex([MutableSequence[tuple]) is recognised as working, which is not true at runtime.
To Reproduce
Provide a minimal runnable pandas example
from typing import reveal_type
import pandas as pd
from collections import UserList, deque
data = [(1,), (2,)]
reveal_type(pd.MultiIndex(data)) # runtime: TypeError: Must pass both levels and codes
reveal_type(pd.MultiIndex(UserList(data))) # runtime: TypeError: Must pass both levels and codes
reveal_type(pd.MultiIndex(deque(data))) # runtime: TypeError: Must pass both levels and codesIndicate which type checker you are using
both
Show the error message received from that type checker while checking your example.
No error message from the type checker, which does not reflect the fact that the example does not work at runtime.
Please complete the following information:
- OS: Windows
- OS Version: 11
- python version: 3.14
- version of type checker: mypy 1.18.2, pyright 1.1.407
- version of installed
pandas-stubs: 5a47589
Additional context
We need to fix MultiIndex.__new__.
Metadata
Metadata
Assignees
Labels
No labels