papermill: Papermill raises error for id field when running jupyter-notebook 6.2 with the -p flag
When running papermill v2.2.1 in an environment where jupyter-notebook v6.2 is installed I am seeing the following error when running with parameters (-p flag)
papermill notebook.ipynb outputs/notebook.ipynb -p my_config --no-progress-bar --log-output
Output:
[NbConvertApp] ERROR | Notebook JSON is invalid: Additional properties are not allowed ('id' was unexpected)
[2021-01-18T09:44:24.218Z] Failed validating 'additionalProperties' in code_cell:
[2021-01-18T09:44:24.218Z] On instance['cells'][0]:
[2021-01-18T09:44:24.218Z] {'cell_type': 'code',
[2021-01-18T09:44:24.218Z] 'execution_count': 1,
[2021-01-18T09:44:24.218Z] 'id': 'nasty-bearing',
[2021-01-18T09:44:24.218Z] 'metadata': {'execution': {'iopub.execute_input': '2021-01-18T09:44:22.903942Z',
[2021-01-18T09:44:24.218Z] 'iopub.status.busy': '2021-01-18T09:44:22.903349Z',
[2021-01-18T09:44:24.218Z] 'iopub.status.idle': '2021-01-18T09:44:22.905999Z',
[2021-01-18T09:44:24.218Z] 'shell.execute_reply': '2021-01-18T09:44:22.905474Z'},
[2021-01-18T09:44:24.218Z] 'papermill': {'duration': 0.01294,
[2021-01-18T09:44:24.218Z] 'end_time': '2021-01-18T09:44:22.906187',
[2021-01-18T09:44:24.218Z] 'exception': False,
[2021-01-18T09:44:24.218Z] 'start_time': '2021-01-18T09:44:22.893247',
[2021-01-18T09:44:24.218Z] 'status': 'completed'},
[2021-01-18T09:44:24.218Z] 'tags': ['injected-parameters']}
I think this may be due to a change in jupyter-notebook v6.2 that has added an “id” field to the cell properties : https://github.com/jupyter/notebook/pull/5928/ .
The error does not occur when jupyter-notebook v6.1.6 or earlier is running
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Fix #568 (unexpected id field) — committed to cristobalcl/papermill by cristobalcl 3 years ago
- Updated pinned papermill version v2.3.0 and up includes a fix to a bug that breaks unit-tests https://github.com/nteract/papermill/issues/568 — committed to alexdunncs/notebook_pge_wrapper by alexdunnjpl 3 years ago
Papermill 2.3.0 on PyPI has the fix included. Conda-forge should update when it gets to auto-rebuilding the package there. Thanks for helping get that patched @cristobalcl