HTML conversion fails with nbformat 5.5.0
- Dominant language
- Python
- Stars
- 313
- Forks
- 176
- PR merge metrics
- No merged PRs in 30d
Description
Since the release of nbformat 5.5.0, the conversion of [this notebook](https://github.com/tum-pbs/PhiFlow/blob/develop/docs/Math_Introduction.ipynb) fails on GitHub Actions.
We have reverted to 5.4.0, which works correctly.
This is the error log with 5.5.0:
```
[NbConvertApp] Converting notebook docs/Math_Introduction.ipynb to html
[NbConvertApp] ERROR | Notebook JSON is invalid: data.cells[{data__cells_x}] must be valid exactly by one definition (0 matches found)
Failed validating in notebook['data']['cells']:
On instance:
[NbConvertApp] ERROR | Notebook is invalid after preprocessor
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.8.13/x64/bin/jupyter-nbconvert", line 8, in
sys.exit(main())
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/jupyter_core/application.py", line 269, in launch_instance
return super().launch_instance(argv=argv, **kwargs)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/traitlets/config/application.py", line 978, in launch_instance
app.start()
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 426, in start
self.convert_notebooks()
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 600, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 563, in convert_single_notebook
output, resources = self.export_single_notebook(
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 491, in export_single_notebook
output, resources = self.exporter.from_filename(
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 190, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 207, in from_file
return self.from_notebook_node(
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/html.py", line 223, in from_notebook_node
return super().from_notebook_node(nb, resources, **kw)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line [38](https://github.com/tum-pbs/PhiFlow/actions/runs/3044041976/jobs/4904884808#step:7:39)6, in from_notebook_node
nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 147, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 3[44](https://github.com/tum-pbs/PhiFlow/actions/runs/3044041976/jobs/4904884808#step:7:45), in _preprocess
self._validate_preprocessor(nbc, preprocessor)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 311, in _validate_preprocessor
nbformat.validate(nbc)
File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/nbformat/validator.py", line [50](https://github.com/tum-pbs/PhiFlow/actions/runs/3044041976/jobs/4904884808#step:7:51)3, in validate
raise error
nbformat.validator.NotebookValidationError: data.cells[{data__cells_x}] must be valid exactly by one definition (0 matches found)
Failed validating in notebook['data']['cells']:
On instance:
```
Contributor guide
Research direction
Reproduce the GitHub Actions conversion for docs/Math_Introduction.ipynb with nbformat 5.5.0 and inspect the nbconvert validation path shown in the error log. Compare behavior with 5.4.0 and identify the compatibility issue in notebook validation or conversion. Done means the notebook converts to HTML successfully without reverting nbformat.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- ci-cd, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100