Skip to content

Commit ef8181c

Browse files
authored
Set execution_state when executing a cell (#25)
1 parent 0a6c683 commit ef8181c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jupyter_server_nbmodel/handlers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ async def _execute_snippet(
226226
with ycell.doc.transaction():
227227
del ycell["outputs"][:]
228228
ycell["execution_count"] = None
229+
ycell["execution_state"] = "running"
229230

230231
outputs = []
231232

@@ -243,7 +244,9 @@ async def _execute_snippet(
243244
reply_content = reply["content"]
244245

245246
if ycell is not None:
246-
ycell["execution_count"] = reply_content.get("execution_count")
247+
with ycell.doc.transaction():
248+
ycell["execution_count"] = reply_content.get("execution_count")
249+
ycell["execution_state"] = "idle"
247250

248251
return {
249252
"status": reply_content["status"],

0 commit comments

Comments
 (0)