-
-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
Describe the bug
For example, when Thing
is an Enum
, series.eq(Thing.MEMBER)
gives an error from mypy
.
To Reproduce
Provide a minimal runnable pandas
example that is not properly checked by the stubs.
from enum import Enum, auto
import pandas as pd
class Thing(Enum):
ONE = auto()
TWO = auto()
series = pd.Series([Thing.ONE])
series.eq(Thing.ONE) # error: Argument 1 to "eq" of "Series" has incompatible type "Thing"; expected "str | bytes | date | datetime | timedelta | <12 more items>" [arg-type]
Indicate which type checker you are using (mypy
or pyright
).
mypy
Show the error message received from that type checker while checking your example.
compare_enums.py:13: error: Argument 1 to "eq" of "Series" has incompatible type "Thing"; expected "str | bytes | date | datetime | timedelta | <12 more items>" [arg-type]
Found 1 error in 1 file (checked 1 source file)
Please complete the following information:
OS: [e.g. Windows, Linux, MacOS]
Windows
OS Version [e.g. 22]
10
python version
3.12.10
version of type checker
1.17.0
version of installed pandas-stubs
2.3.0.250703
Additional context
None
Metadata
Metadata
Assignees
Labels
No labels