Closed
Description
Describe the bug
A clear and concise description of what the bug is.
For the pd.DataFrame.pct_change
the documentation allows the None
method but the typing only supports str
.
This results in an error from pyright to be raised.
To Reproduce
- Provide a minimal runnable
pandas
example that is not properly checked by the stubs. - Indicate which type checker you are using (
mypy
orpyright
). - Show the error message received from that type checker while checking your example.
df = pd.DataFrame({"x": [1, 2, 2, 3, 3], "y": [10, 20, 30, 40, 50]})
df.pct_change(fill_method=None)
This example will yield the error:
error: Argument "fill_method" to "pct_change" of "DataFrame" has incompatible type "None"; expected "str" [arg-type]
While the documentation allows for None:
Please complete the following information:
- OS: MacOs
- OS Version Sonoma 14
- python version 3.12.4
- version of type checker 1.1.378
- version of installed
pandas-stubs
v2.2.2.240807
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels