jupyter / nbformat

Reference implementation of the Jupyter Notebook format
http://nbformat.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
259 stars 153 forks source link

Add strip_invalid_metadata argument to validator normalize method #355

Closed jonabc closed 1 year ago

jonabc commented 1 year ago

:wave: This update adds the strip_invalid_metadata argument to the public normalize method, passing the argument into the nonpublic _normalize method rather than always passing false.

The reason behind this change is that the _normalize method only uses the relax_add_props argument when strip_invalid_metadata is true. That argument is currently hardcoded to false by normalize, making the relax_add_props argument functionality unused. By allowing callers to specify strip_invalid_metadata, there is at least a chance that the relax_add_prop argument will also be used.

I didn't see any tests in this project related to the normalize method, so I wasn't sure what might be needed for tests.