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 relaxation flag to validator call #103

Merged
merged 2 commits into from Aug 10, 2017
Merged

Conversation

mpacer
Copy link
Member

@mpacer mpacer commented Aug 9, 2017

This arises in the context of determining what sorts of intermediate representations we want for notebooks in nbconvert: jupyter/nbconvert#643

It was suggested by @minrk that we only allow additional fields (and no additional values for existing fields or the deletion of fields) in terms of this intermediate representation.

Up until now, we thought that preprocessors had always only created valid notebooks. That turns out to be not be the case (jupyter/nbconvert#645).

It would be nice to be able to establish that the only things allowed by preprocessors is to exactly what we say it is.

To that end, this adds a flag to the validate API (and the get_validator API) for communicating that that specific relaxation is to be adhered to and otherwise the notebook is entirely valid.

This allows the use of nbformat.validate(…, relax_add_props=True) in the nbconvert preprocessor checks which will ensure that 3rd party preprocessors similarly adhere to this restriction on the nbconvert internal representation.

@minrk minrk merged commit 988571d into jupyter:master Aug 10, 2017
@mpacer mpacer added this to the 4.4 milestone Aug 11, 2017
minrk added a commit to jupyter/nbconvert that referenced this pull request Aug 21, 2017
add step to validate preprocessors that relies on jupyter/nbformat#103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants