I have updated PickleFileProcessor to be able to load dataframes dumped in backward pandas versions.
background
Because the pandas dataframe dumped by pickle is not backward compatible, TargetOnKart cannot load the cache of dataframes dumped in backward pandas version.
For example, TargetOnKart in pandas 2.1.0 cannot load the large dataframe dumped in pandas 1.5.3 (error: ModuleNotFoundError: No module named 'pandas.core.indexes.numeric').
Solution
In fact, pd.read_pickle can load the dataframe dumped by lower pandas version by patching pickle.load in pandas, so we can avoid the problem by using pd.read_pickle instead of dill.load.
pd.read_pickle can also load any objects other than dataframes, even the objects dumped by dill, we can naturally use it in PickleFileProcessor.
I have updated
PickleFileProcessor
to be able to load dataframes dumped in backward pandas versions.background
Because the pandas dataframe dumped by pickle is not backward compatible, TargetOnKart cannot load the cache of dataframes dumped in backward pandas version. For example, TargetOnKart in pandas 2.1.0 cannot load the large dataframe dumped in pandas 1.5.3 (error:
ModuleNotFoundError: No module named 'pandas.core.indexes.numeric'
).Solution
In fact,
pd.read_pickle
can load the dataframe dumped by lower pandas version by patchingpickle.load
in pandas, so we can avoid the problem by usingpd.read_pickle
instead ofdill.load
.pd.read_pickle
can also load any objects other than dataframes, even the objects dumped by dill, we can naturally use it inPickleFileProcessor
.