From af30bbfd7f4635c159aa2568bd49b2f80452ccde Mon Sep 17 00:00:00 2001 From: Nick Wold Date: Mon, 24 Jan 2022 09:48:51 -0800 Subject: [PATCH] Update nbformat/validator.py Co-authored-by: Paul Ivanov --- nbformat/validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbformat/validator.py b/nbformat/validator.py index 2df2acaf..46ab6716 100644 --- a/nbformat/validator.py +++ b/nbformat/validator.py @@ -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.