Closed soobidou closed 1 year ago
For context:
ipywidgets 8.0 was released yesterday, which is a major version upgrade with breaking changes.
From the above error, it looks like this change in ipywidgets 8 is affecting you:
Drop support for mapping types as selection options (#2679, #1958)
From the looks of it, you may need to just update line 49 below:
File /opt/conda/lib/python3.8/site-packages/autovizwidget/widget/encodingwidget.py:48, in EncodingWidget.__init__(self, df, encoding, change_hook, ipywidget_factory, testing, **kwargs)
46 options_x_view = {text(i): text(i) for i in self.df.columns}
47 options_x_view["-"] = None
---> 48 self.x_view = self.ipywidget_factory.get_dropdown(
49 options=options_x_view, description="X", value=self.encoding.x
50 )
My guess is that options_x_view is a dictionary (using a dictionary there has been deprecated for years), and should be converted to a list of values or a list of (label, value) tuples. I think you can change it to options_x_view.items()
Or it looks like you can define options_x_view as:
options_x_view = [(text(i), text(i)) for i in self.df.columns]
options_x_view.append(("-", None))
I worked around by installing this after sparkmagic==0.20.0:
jupyter labextension install @jupyter-widgets/jupyterlab-manager@3.1.1
pip install ipywidgets==7.7.0 jupyterlab-widgets==1.1.1 widgetsnbextension==3.6.1
Not sure about the 7.7.x, I had mixed results during the day, they were obviously altered. Might be good idea to pin such dependencies so that users relying on a pinned version get a consistent behavior.
FYI, with JupyterLab 3.x, if JupyterLab and the kernel are in the same environment, you don't need to do both the jupyter labextension install @jupyter-widgets/jupyterlab-manager@3.1.1
and install jupyterlab-widgets==1.1.1
. We recommend just doing the pip install
, without the jupyter labextension install
these days.
Also, if you install ipywidgets 7.7.2, you'll get (a) some bugfixes in 7.7.1, as well as (b) the updated jupyterlab_widgets dependency on the correct version of jupyterlab_widgets. But yes, it's always a good idea to pin dependencies exactly (or at least to the minor version) for reproducibility.
tldr; if your jupyterlab and kernel are in the same environment, you should be able to do
pip install ipywidgets==7.7.2 jupyterlab-widgets==1.1.1 widgetsnbextension==3.6.1
to pin dependencies exactly to ipywidgets 7.
Lates version was fine couple days ago and broke because of Ipywidgets probably doing a major non-backward compatible change
I see in requirements.txt that SparkMagic constraints are ipywidgets>5.0.0
Here's what happen after the Livy session is loaded up:
Still investigating.