MarcelRobeer / explabox

Explore/examine/explain/expose your model with the explabox!
https://explabox.readthedocs.io
GNU Lesser General Public License v3.0
14 stars 0 forks source link

Drugsreview notebook doesn't work properly due to specific pandas package version #5

Closed riwish closed 1 year ago

riwish commented 1 year ago

Summary of bug

The drugsreview dataset throws an error during the processing of ingestibles. The error being thrown is module 'pandas.io.common' has no attribute '_compression_to_extension'

Environment information

Reproducing the bug

Steps to reproduce the behavior:

Run the first couple of cells of the current explabox durgsreview demo notebook, section '1. Ingestibles'

from explabox import import_data
data = import_data(dataset_file, data_cols='review', label_cols='rating')
...

Solutions Attempted

I Googled the exception and saw it may be caused due to relying on a specific pandas version. I tried downgrading pandas 1.5.3 to 1.4.0 and the error was gone.

Expected behavior

A successfully completed Jupyter Notebook Cell without errors

MarcelRobeer commented 1 year ago

This indeed seems to be because of a update of pandas (pd) versions, where in pandas.io.common the dictionary _compression_to_extension has been changed over to extension_to_compression. The issue comes from dependency genbase, which I will update.

Change in genbase.data.__init__:

...
if file_type in pd.io.common._compression_to_extension.values():
    ...

to

...
extensions = pd.io.common._compression_to_extension.values() \
    if hasattr(pd.io.common, '_compression_to_extension') \
    else pd.io.common.extension_to_compression.keys()
if file_type in extensions:
    ...