-
Notifications
You must be signed in to change notification settings - Fork 308
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
Validate notebooks once per fetch or save #724
Conversation
Codecov Report
@@ Coverage Diff @@
## main #724 +/- ##
==========================================
+ Coverage 70.95% 70.96% +0.01%
==========================================
Files 62 62
Lines 7515 7523 +8
Branches 1190 1192 +2
==========================================
+ Hits 5332 5339 +7
- Misses 1826 1832 +6
+ Partials 357 352 -5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you please install and run pre-commit
on all the files?
pip install pre-commit
pre-commit install
pre-commit run --all-files
Thanks Steve, that was helpful. |
Kicking CI to pick up fixes |
Some prior network analyses found that each fetch and save of a notebook file resulted in double validation, presumably so the server could set a helpful message on the notebook model returned to the user since the validation performed within
nbformat
's read or write methods did not return any indication of a validation error.nbformat
was recently updated to enable applications to ask for validation error status on the initial read/write calls, thereby enabling notebook to skip its second call to validate the notebook. This pull request leverages those updated signatures now available innbformat 5.2.0
.The existing
validate_notebook_model()
, however, will still callnbformat.validate()
if aNone
validation_error
parameter is provided. This was done in order to preserve existing functionality from potential calls by server extensions. The message generation code is shared by both by raising the exception present in thevalidation_error
dictionary.(The CI failures do not appear to be related to these changes.)