Description
Note: the underlying issue might be the cause of jupyter/notebook#6828.
The nb0.ipynb
notebook used as an expectation in tests is invalid and does not even render on GitHub:
It is used in this test:
jupyter_ydoc/tests/test_ypy_yjs.py
Lines 51 to 62 in 1ec81ff
And contains two code cells with id
set to null
:
{
"cells": [
{
"cell_type": "code",
"source": [
"print('Hello, World!')"
],
"metadata": {},
"outputs": [],
"execution_count": null,
"id": null
},
{
"cell_type": "code",
"source": "print('Hello, World!')",
"metadata": {},
"outputs": [],
"execution_count": null,
"id": null
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
While execution_count
can be null
, id
cannot, compare specification:
Code cells are the primary content of Jupyter notebooks. They contain source code in the language of the document’s associated kernel, and a list of outputs associated with executing that code. They also have an
execution_count
, which must be an integer ornull
.
Since the 4.5 schema release, all cells have an
id
field which must be a string of length 1-64 with alphanumeric, -, and _ as legal characters to use. These ids must be unique to any given Notebook following the nbformat spec.
And schema:
"execution_count": {
"description": "The code cell's prompt number. Will be null if the cell has not been run.",
"type": ["integer", "null"],
"minimum": 0
}
"definitions": {
"cell_id": {
"description": "A string field representing the identifier of this particular cell.",
"type": "string",
"pattern": "^[a-zA-Z0-9-_]+$",
"minLength": 1,
"maxLength": 64
}
}