uchicago-cs / deepdish

Flexible HDF5 saving/loading and other data science tools from the University of Chicago
http://deepdish.io
BSD 3-Clause "New" or "Revised" License
271 stars 60 forks source link

Incompatibility with pandas v1.2.0 #45

Closed ACCarnall closed 3 years ago

ACCarnall commented 3 years ago

Hi guys,

Thanks for the incredibly useful piece of software!

The recent release of v1.2.0 of pandas seems to have broken compatibility with deepdish. Things work perfectly with pandas v1.1.5 and deepdish v0.3.6, however upgrading to pandas v1.2.0 produces the following error:

File "/Users/adam/anaconda3/lib/python3.8/site-packages/deepdish/io/hdf5io.py", line 583, in save _save_level(h5file, group, value, name=key, File "/Users/adam/anaconda3/lib/python3.8/site-packages/deepdish/io/hdf5io.py", line 211, in _save_level _save_level(handler, new_group, v, name=k, filters=filters, File "/Users/adam/anaconda3/lib/python3.8/site-packages/deepdish/io/hdf5io.py", line 211, in _save_level _save_level(handler, new_group, v, name=k, filters=filters, File "/Users/adam/anaconda3/lib/python3.8/site-packages/deepdish/io/hdf5io.py", line 251, in _save_level elif _pandas and isinstance(level, (pd.DataFrame, pd.Series, pd.Panel)): File "/Users/adam/anaconda3/lib/python3.8/site-packages/pandas/init.py", line 244, in getattr raise AttributeError(f"module 'pandas' has no attribute '{name}'") AttributeError: module 'pandas' has no attribute 'Panel'

It looks like pandas.Panel has been removed from the latest release. Presumably all that needs to be done is removing references to pd.Panel from hdf5io.py? I'd be happy to submit this as a pull request if you agree this is the right course of action.

Cheers, Adam

ejolly commented 3 years ago

I would love to see as well! Several projects I contribute to/maintain that make use of deepdish currently need to pin their maximum pandas versions until this is handled:

nbgit10 commented 3 years ago

Hi, I had the same issue. I have removed the pd.Panel reference in the IO module as well as the corresponding test. Feel free to use my fork or create a pull request based on that. There is no real disadvantage since pd.Panel is deprecated since 0.20.0 and code that still uses pd.Panel could just use an earlier version of deepdish.

RafalSkolasinski commented 3 years ago

Hey, any update on this? Seems quite crucial for the library to still be handy and useful

gustavla commented 3 years ago

Really sorry about this. Thank you @nbgit10 for the PR (#48). I merged it and pushed version 0.3.7 to PyPI. Please give pip install -U deepdish and try and re-open this if it didn't work.

tegusi commented 2 years ago

@gustavla Sorry to bother you, but it seems this still exists in the latest version today(2021/10/30) with deepdish 0.3.7. AttributeError: module 'pandas' has no attribute 'io'