-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
pd.to_pickle([], "path")
Type check the above code with e.g. mypy.Issue Description
mypy will say that there is no to_pickle function in pandas, even though the function is there. There was a discussion about how deprecating this function is a good idea in #48402, but it was never deprecated. Even if it were deprecated, removing it from the type stubs completely would not be correct - it should be marked deprecated in the type stub. Removing the function entirely simply because a function was considered being deprecated doesn't seem good.
This came up for me while upgrading my python environment; the upgrade brought pandas-stubs from 2.3.0.250703 to 2.3.2.250926. We use this function dozens of times, and the code still works perfectly, but the mypy checks fail. I could sit down and spend the time to solve this problem as if this function really were going away shortly, but since the function is there, still part of the public API (i.e. part of all), still not deprecated, I'd prefer not to. Can the stub for to_pickle be added back to pandas-stubs for the next release?
Expected Behavior
N/A
Installed Versions
Not relevant