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

Cannot override settings by null value #278

Open
aidy1991 opened this issue May 30, 2022 · 4 comments
Open

Cannot override settings by null value #278

aidy1991 opened this issue May 30, 2022 · 4 comments
Labels

Comments

@aidy1991
Copy link

Description

Our application uses jupyterlab's settings override feature to change the settings of some extensions.
However, due to an upgrade of jupyterlab_server (v2.5.2 => v2.12.0), the settings are no longer overridden.
From my investigation, settings are not overridden if the value is null, as in { "format": null }. This is probably because recursive_update used in the following location ignores properties with the value None.

recursive_update(overrides.setdefault(plugin_id, {}), config)

Reproduce

I faced this problem when overriding the jupyter-archive configuration. Therefore, below I describe how to reproduce the problem in the case of jupyter-archive. However, the same should be true for other settings as well.

  1. Install jupyter-archive extension
  2. Check the default setting of format is zip on Advanced Settings Editor
  3. Add sys.prefix>/local/share/jupyter/lab/settings/overrides.json and see below for the contents of this file
  4. Check that the default setting of format is not overridden
    (5. If you set non-null value like tgz, it works well)

Expected behavior

In previous versions of jupyterlab_server, setting values could be overridden with null. Newer versions should be able to do the same, I think.

Context

  • JupyterLab version: 3.0.16
  • jupyterlab_server that worked well: 2.5.2
  • jupyterlab_server that does not work well: 2.12.0
@aidy1991 aidy1991 added the bug label May 30, 2022
@welcome
Copy link

welcome bot commented May 30, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@blink1073
Copy link
Member

Hi @aidy1991, would you open to submitting a PR to jupyter_server to add handling of None in recursive_update?

@aidy1991
Copy link
Author

aidy1991 commented Jun 7, 2022

Hi blink1073, thank you for your reply!

jupyter_server's recursive_update() is already handling None.
Removing key from target when value is None is a specification of recursive_update() and has been so for 5 years.
https://github.com/jupyter-server/jupyter_server/blob/3e64fa5eef7fba9f8e17c30cec688254adf913bd/jupyter_server/config_manager.py#L28-L30

On the other hand, jupyterlab_server changed its usage of recursive_update() 6 months ago.
Therefore, I think we need to address this issue on the jupyterlab_server side.
e0fc91b#diff-9af31a1313a162bb540c3ae2c11a74ee859d433f83814c0769c8a1d4ce0e4405R302

@blink1073
Copy link
Member

Ah, I see. A PR here would be welcome then. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants