Skip to content

DeprecationWarning due to widgets/interaction.py's on_submit call #3669

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

Closed
collares opened this issue Jan 18, 2023 · 1 comment · Fixed by #3670
Closed

DeprecationWarning due to widgets/interaction.py's on_submit call #3669

collares opened this issue Jan 18, 2023 · 1 comment · Fixed by #3670

Comments

@collares
Copy link

collares commented Jan 18, 2023

Description

When running Sagemath tests after upgrading to ipywidgets 8.0.4, one of the tests emits the following deprecation warning:

DeprecationWarning: on_submit is deprecated. Instead, set the .continuous_update attribute to False and observe the value changing with: mywidget.observe(callback, 'value').

The stack trace reveals that the offending on_submit call is coming from ipywidgets itself, at

Relevant part of the stack trace:

      File "<doctest sage.interacts.library.?[0]>", line 1, in <module>
        interacts.calculus.riemann_sum()
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/sage/interacts/library.py", line 136, in library_wrapper
        interact(f, **widgets_constructed)
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/ipywidgets/widgets/interaction.py", line 510, in __call__
        w = self.widget(f)
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/ipywidgets/widgets/interaction.py", line 426, in widget
        return self.cls(f, self.opts, **self.kwargs)
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/sage/repl/ipython_kernel/interact.py", line 126, in __init__
        super().__init__(f, options, **kwds)
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/ipywidgets/widgets/interaction.py", line 211, in __init__
        w.on_submit(self.update)
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/ipywidgets/widgets/widget_string.py", line 145, in on_submit
        deprecation("on_submit is deprecated. Instead, set the .continuous_update attribute to False and observe the value changing with: mywidget.observe(callback, 'value').")
      File "/nix/store/0yc2dwvpgvzj6mjp1495pz3bp2g7xrcd-python3-3.10.9-env/lib/python3.10/site-packages/ipywidgets/widgets/utils.py", line 64, in deprecation
        warnings.warn(message, DeprecationWarning, stacklevel=stacklevel+1)
      File "/nix/store/abax98471z8fshv4b9p46bkh3lxmpy0z-python3-3.10.9/lib/python3.10/warnings.py", line 109, in _showwarnmsg
        sw(msg.message, msg.category, msg.filename, msg.lineno,
    :
    DeprecationWarning: on_submit is deprecated. Instead, set the .continuous_update attribute to False and observe the value changing with: mywidget.observe(callback, 'value').
@jasongrout
Copy link
Member

Thanks for reporting this. Fixed over in #3670.

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 a pull request may close this issue.

2 participants