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

Add explicit handling of warnings #771

Merged
merged 6 commits into from Apr 2, 2022

Conversation

blink1073
Copy link
Collaborator

No description provided.

@blink1073
Copy link
Collaborator Author

Wow, this is s tricky one, I can't figure out the spelling of how to get jupyter server --ServerApp.jpserver_extensions to work from the command line. Looking at the test in traitlets, it seems like it should be something like:

jupyter server --ServerApp.jpserver_extensions "myextension=enabled True" but that gives me:

[C 2022-04-01 07:47:07.069 ServerApp] Bad config encountered during initialization: The 'jpserver_extensions' trait of a ServerApp instance expected a dict, not the list ['myextension=enabled True'].

@blink1073
Copy link
Collaborator Author

This simple test works without warnings:

from traitlets.config.application import Application
from traitlets import Dict

class Foo(Application):

    bar = Dict().tag(config=True)

    def start(self):
        print(self.bar)
        return super().start()


if __name__ == '__main__':
    Foo().launch_instance()
$ python test.py --Foo.bar foo=fizz
{'foo': 'fizz'}

@kevin-bates
Copy link
Member

I've always struggled with this. I just found these forms to work (and do the right thing):

jupyter server --ServerApp.jpserver_extensions="elyra=False"
jupyter server --ServerApp.jpserver_extensions=elyra=True
jupyter server --ServerApp.jpserver_extensions elyra=False
jupyter server --ServerApp.jpserver_extensions "elyra=True"

Not sure what would happen if there were multiple traits for each extension and why/how it knows the boolean value applies to the enabled trait.

@blink1073
Copy link
Collaborator Author

Thanks! I updated the docs as well

@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2022

Codecov Report

Merging #771 (34e572a) into main (25ec3ed) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #771      +/-   ##
==========================================
+ Coverage   70.32%   70.34%   +0.02%     
==========================================
  Files          62       62              
  Lines        7554     7554              
  Branches     1248     1248              
==========================================
+ Hits         5312     5314       +2     
+ Misses       1859     1858       -1     
+ Partials      383      382       -1     
Impacted Files Coverage Δ
jupyter_server/pytest_plugin.py 84.16% <100.00%> (ø)
jupyter_server/services/kernels/handlers.py 58.93% <0.00%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25ec3ed...34e572a. Read the comment docs.

@blink1073 blink1073 merged commit f6f8c3f into jupyter-server:main Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants