Skip to content

Commit

Permalink
Update nbformat/validator.py
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Ivanov <[email protected]>
  • Loading branch information
nicholaswold and ivanov authored Jan 24, 2022
1 parent 5f97c02 commit af30bbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nbformat/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def iter_validate(nbdict=None, ref=None, version=None, version_minor=None,
error_for_intended_schema = error.schema_path[0] == schema_index
is_top_level_metadata_key = len(rel_path) == 2 and rel_path[0] == "metadata"
if error_for_intended_schema and is_top_level_metadata_key:
nbdict["cells"][cell_idx][rel_path[0]].pop(rel_path[1], None)
nbdict["cells"][cell_idx]["metadata"].pop(rel_path[1], None)

# Validate one more time to ensure that us removing metadata
# didn't cause another complex validation issue in the schema.
Expand Down

0 comments on commit af30bbf

Please sign in to comment.