-
Notifications
You must be signed in to change notification settings - Fork 131
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
Fix #262: JSONErrorsMixin not returning correct results #263
Fix #262: JSONErrorsMixin not returning correct results #263
Conversation
After Notebook 5.2.0 is installed, JSONErrorsMixin.write_error is used to convert errors into JSON responses. Previously, Notebook's `@json_errors` decorator performed this action. Since the decorator's replacement, `APIHandler.write_error`, doesn't adequately set the `reason` field, other tests fail so its not sufficient to drop the use of JSONErrorsMixin. As a result, JSONErrorsMixin now incorporates the appropriate code from `APIHandler.write_error` (in particular the setting of the `traceback` field) - in addition to appropriately setting the `reason` field. This mixin should continue to be used in the handler class hierachy until `APIHandler` is fixed. I have tested these changes with Notebook 5.1.0 and 5.2.0 installed.
I currently don't have time to dig deeper into the problem, but I had a look at the diff, and it looks good. |
Thanks for digging into this issue. It's not the first time we've found we've found an incompatibility with new notebook versions because KG is definitely touches more than the public API of the notebook server. Is notebook>=5.2.0 now a requirement after this patch goes in? Or will it work with notebook 5.0 and up? I'm asking to see if we need to (1) bump the required minimum notebook version to 5.2 now and (2) see if this should be a patch release or a minor release, assuming we're sticking with semantic versioning. |
Hi @parente. No, this update doesn't introduce any dependency change on notebook versions. When notebook 5.1.0 (or less) is in play In addition, once the notebook issue with |
Sorry for the delay on this one. I can work on backporting this to the 2.0.x branch to cut a 2.0.2 release with it soon. |
@parente: Can you find some time for cutting a new release? |
@rolweber @kevin-bates I've tagged 2.0.2 and pushed a release to pypi. |
@parente - thank you! Does something similar need to happen for anaconda envs? (Sorry, total newbie to this python stuff). Since our tests run via anaconda envs it still looks like they're picking up 2.0.1 from conda-forge.
|
@kevin-bates Indeed. I'll cc on the PR over in the conda-forge feedstock. |
Awesome. Thank you @parente! |
After Notebook 5.2.0 is installed, JSONErrorsMixin.write_error is
used to convert errors into JSON responses. Previously, Notebook's
@json_errors
decorator performed this action. Since the decorator'sreplacement,
APIHandler.write_error
, doesn't adequately set thereason
field, other tests fail so its not sufficient to drop theuse of JSONErrorsMixin. As a result, JSONErrorsMixin now incorporates
the appropriate code from
APIHandler.write_error
(in particular thesetting of the
traceback
field) - in addition to appropriatelysetting the
reason
field. This mixin should continue to be usedin the handler class hierachy until
APIHandler
is fixed.I have tested these changes with Notebook 5.1.0 and 5.2.0 installed.
Fixes #262.