python-diskcache
python-diskcache copied to clipboard
Bug with pandas 2.0
trafficstars
I'm getting error when use disk cache with pandas 2.0 : ModuleNotFoundError: No module named 'pandas.core.indexes.numeric' at diskcache/core.py", line 282, in fetch return pickle.load(reader) It worked if i downgrade pandas to version 1.5.x, how to resolve this ?
That's just that you've saved something with Pandas 1.5, and now that you try to load the same data with Pandas 2.0, the modules unpickling attempts to find are not there anymore.
Pickle is not a good way to save pandas DataFrames. It is neither performant nor safe between versions. One should probably override persistence to store as Parquet or similar.