Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin dask ipywidgets version to 7.7.1 #1442

Merged
merged 1 commit into from
Sep 22, 2022
Merged

Pin dask ipywidgets version to 7.7.1 #1442

merged 1 commit into from
Sep 22, 2022

Conversation

viniciusdc
Copy link
Contributor

Changes introduced in this PR:

  • Pin ipywidgets to 7.7.1 for the Dask built-in environment.

The latest ipywidgets 8.x removed an essential method used by dask-gateway when using the client widgets. This is a short-term solution.

Types of changes

What types of changes does your PR introduce?

Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests?

  • Yes
  • No

Documentation

Does your contribution include breaking changes or deprecations?
If so have you updated the documentation?

  • Yes, docstrings
  • Yes, main documentation
  • Yes, deprecation notices

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered and more.

@iameskild
Copy link
Member

Thanks for the update @viniciusdc!
As I was testing the dask dashboards for the v0.4.4 release, my basic test seemed to work using both ipywidget 7.x and 8.x. Is this something that you think needs to be included in the v0.4.4 release?

@viniciusdc
Copy link
Contributor Author

Thanks for the update @viniciusdc! As I was testing the dask dashboards for the v0.4.4 release, my basic test seemed to work using both ipywidget 7.x and 8.x. Is this something that you think needs to be included in the v0.4.4 release?

Hi @iameskild that's good to know, did you try running the snippet bellow?

options = gateway.cluster_options()
options

@iameskild
Copy link
Member

iameskild commented Sep 22, 2022

Thanks for pointing this out @viniciusdc!

When running the following, I unfortunately I get an error for both ipywidget versions.

from dask_gateway import Gateway
gateway = Gateway()
options = gateway.cluster_options()
options

Here's what I get with ipywidgets 8.x - expected based on your comments above:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File /home/conda/filesystem/50d20409d0f86927105b69a2dfd2298cd115a880b6bb965f6d3e0719186801d4-20220922-025319-219615-2-dask/lib/python3.9/site-packages/IPython/core/formatters.py:921, in IPythonDisplayFormatter.__call__(self, obj)
    919 method = get_real_method(obj, self.print_method)
    920 if method is not None:
--> 921     method()
    922     return True

File /home/conda/filesystem/50d20409d0f86927105b69a2dfd2298cd115a880b6bb965f6d3e0719186801d4-20220922-025319-219615-2-dask/lib/python3.9/site-packages/dask_gateway/options.py:77, in Options._ipython_display_(self, **kwargs)
     75 widget = self._widget()
     76 if widget is not None:
---> 77     return widget._ipython_display_(**kwargs)
     78 from IPython.lib.pretty import pprint
     80 pprint(self)

AttributeError: 'VBox' object has no attribute '_ipython_display_'

And here's what I get with ipywidgets 7.7.1:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'VBoxModel' from module '@jupyter-widgets/controls'
Error: Module @jupyter-widgets/controls, version ^1.5.0 is not registered, however,         2.0.0 is
    at f.loadClass (https://eaerel.qhub.dev/user/eskild/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:74977)
    at f.loadModelClass (https://eaerel.qhub.dev/user/eskild/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:10729)
    at f._make_model (https://eaerel.qhub.dev/user/eskild/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:7517)
    at f.new_model (https://eaerel.qhub.dev/user/eskild/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:5137)
    at f.handle_comm_open (https://eaerel.qhub.dev/user/eskild/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:3894)
    at _handleCommOpen (https://eaerel.qhub.dev/user/eskild/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:73393)
    at b._handleCommOpen (https://eaerel.qhub.dev/user/eskild/static/lab/jlab_core.1d4a092221669bba35bb.js?v=1d4a092221669bba35bb:2:996482)
    at async b._handleMessage (https://eaerel.qhub.dev/user/eskild/static/lab/jlab_core.1d4a092221669bba35bb.js?v=1d4a092221669bba35bb:2:998472)

It looks like we might need to upgrade jupyter-widgets as well. I'm currently trying to test this now.

@viniciusdc
Copy link
Contributor Author

Thanks for checking that out @iameskild , are you sure the env you ran had ipywidgets==7.7.1 ? I did run using that pin in the Dashboards env it seemed to work, but i might have missed something

@iameskild
Copy link
Member

That's interesting... I can confirm that I'm using ipywidgets ==7.7.1:

import ipywidgets
ipywidgets.__version__

'7.7.1'

We're also installing ipywidget in the JupyterLab Docker image. Do you think it would make a difference if we made the update there as well?

@viniciusdc
Copy link
Contributor Author

I dont think that would help, I thought conda-store didnt update the build but of you can match the versions from the module then thats not the case. I will debug this later as well

@iameskild iameskild merged commit 17ae8ee into main Sep 22, 2022
@iameskild iameskild deleted the pin-dask-ipywidgets branch September 22, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants