Skip to content

Commit 00ca649

Browse files
Allow empty notebook (#266)
1 parent 925b257 commit 00ca649

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

jupyter_ydoc/ynotebook.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,7 @@ def set(self, value: Dict) -> None:
222222
nb_without_cells = {key: value[key] for key in value.keys() if key != "cells"}
223223
nb = copy.deepcopy(nb_without_cells)
224224
cast_all(nb, int, float) # Yjs expects numbers to be floating numbers
225-
cells = value["cells"] or [
226-
{
227-
"cell_type": "code",
228-
"execution_count": None,
229-
# auto-created empty code cell without outputs ought be trusted
230-
"metadata": {"trusted": True},
231-
"outputs": [],
232-
"source": "",
233-
"id": str(uuid4()),
234-
}
235-
]
225+
cells = value["cells"]
236226

237227
with self._ydoc.transaction():
238228
# clear document

0 commit comments

Comments
 (0)