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 strip_invalid_metadata argument to validator normalize method #355

Merged
merged 1 commit into from
Mar 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions nbformat/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def normalize(
version_minor: Optional[int] = None,
*,
relax_add_props: bool = False,
strip_invalid_metadata: bool = False,
) -> Tuple[int, Any]:
"""
Normalise a notebook prior to validation.
Expand All @@ -282,8 +283,11 @@ def normalize(
version : int
version_minor : int
relax_add_props : bool
Wether to allow extra property in the Json schema validating the
Whether to allow extra property in the Json schema validating the
notebook.
strip_invalid_metadata : bool
Whether to strip metadata that does not exist in the Json schema when
validating the notebook.

Returns
-------
Expand All @@ -305,7 +309,7 @@ def normalize(
version_minor,
True,
relax_add_props=relax_add_props,
strip_invalid_metadata=False,
strip_invalid_metadata=strip_invalid_metadata,
)


Expand Down