-
Notifications
You must be signed in to change notification settings - Fork 304
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
Conversation
Wow, this is s tricky one, I can't figure out the spelling of how to get
[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']. |
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'} |
I've always struggled with this. I just found these forms to work (and do the right thing):
Not sure what would happen if there were multiple traits for each extension and why/how it knows the boolean value applies to the |
Thanks! I updated the docs as well |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
No description provided.