Skip to content

Commit 91c3b9a

Browse files
committed
Add cell execution_state
1 parent 8d918eb commit 91c3b9a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jupyter_ydoc/ynotebook.py

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class YNotebook(YBaseDoc):
3838
"cell_type": str,
3939
"source": YText,
4040
"metadata": YMap,
41+
"execution_state": str,
4142
"execution_count": Int | None,
4243
"outputs": [] | None,
4344
"attachments": {} | None
@@ -100,6 +101,7 @@ def get_cell(self, index: int) -> Dict[str, Any]:
100101
"""
101102
meta = self._ymeta.to_py()
102103
cell = self._ycells[index].to_py()
104+
cell.pop("execution_state", None)
103105
cast_all(cell, float, int) # cells coming from Yjs have e.g. execution_count as float
104106
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
105107
# strip cell IDs if we have notebook format 4.0-4.4
@@ -164,6 +166,7 @@ def create_ycell(self, value: Dict[str, Any]) -> Map:
164166
output["text"] = Array(output.get("text", []))
165167
outputs[idx] = Map(output)
166168
cell["outputs"] = Array(outputs)
169+
cell["execution_state"] = "idle"
167170

168171
return Map(cell)
169172

0 commit comments

Comments
 (0)