lux-org / lux

Automatically visualize your pandas dataframe via a single print! 📊 💡
Apache License 2.0
5.15k stars 365 forks source link

[BUG] New pandas versions seem to break Vis aggregation #492

Open WillSealy opened 1 year ago

WillSealy commented 1 year ago

Describe the Bug The merge call in the execute_aggregate function (lux -> executor -> PandasExecutor -> line 237) fails on pandas versions >1.4.4, which forces Lux to revert to pandas display and stops the widget from rendering. Guessing this has something to do with pandas 1.5.x changes to the groupby function.

To Reproduce

import pandas as pd
import lux
df = pd.read_csv("https://github.com/lux-org/lux-datasets/blob/master/data/car.csv?raw=true")
df.intent = ['Brand', 'Origin']
df

Line that fails: vis._vis_data = vis.data.merge(df,on=[columns[0], columns[1]],how="right",suffixes=["", "_right"],)

Screenshots

image

Debugging information

Package Versions

           Version      
    python        3.8.13
       lux         0.5.1
    pandas         1.5.0
 luxwidget        0.1.11
matplotlib         3.5.3
    altair         4.2.0
   IPython         8.5.0
 ipykernel        6.15.2
ipywidgets         8.0.2

jupyter_client 7.3.5 jupyter_core 4.11.1 jupyter_server not installed jupyterlab not installed nbclient not installed nbconvert 5.4.1 nbformat 5.5.0 notebook 6.4.12 qtconsole 5.3.2 traitlets 5.4.0

Widget Setup

✅ Jupyter Notebook Running ✅ luxwidget is enabled

fredthedead commented 1 year ago

Getting the same error

jona-sassenhagen commented 1 year ago

Here is a minimally reproducible example:

import pandas as pd
import lux
pd.Series(range(100)).astype(str)