You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess it's enough to change from dict to Mapping in the type signature, since it seems to work even if the argument is not a dict (for example if it's a MappingProxyType instance).
Alternative Solutions
I guess an alternative solution is just to type ignore the replace invocation.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Have you installed the pandas-stubs package? It is an extension of the pandas repo for types.
I have tried locally in an environment where pandas-stubs is installed and no warning are raised (pyright/mypy).
Can you provide how you typecheck this code?
I see why you are seeing the issue and I don't, can you try running with pandas-stubs on main: uv pip install "git+https://github.com/pandas-dev/pandas-stubs.git"
With your setup I saw the error, with the stubs repo on main I don't meaning that it was fixed in: pandas-dev/pandas-stubs#1164
Please let me know if when pulling from main you still see the issue, we should be able to ask for a new release of the stubs.
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
Currently the
replace
method ofSeries
allows onlydict
, but notMapping
inputs, as theDataFrame
one does.For example:
Feature Description
I guess it's enough to change from
dict
toMapping
in the type signature, since it seems to work even if the argument is not a dict (for example if it's aMappingProxyType
instance).Alternative Solutions
I guess an alternative solution is just to type ignore the replace invocation.
Additional Context
No response
The text was updated successfully, but these errors were encountered: