Skip to content

Commit 283cd46

Browse files
committed
Allow reload of outputs array if none of the outputs is a stream
1 parent 1939163 commit 283cd46

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

jupyter_ydoc/ynotebook.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,14 @@ def _update_cell(self, old_cell: dict, new_cell: dict, old_ycell: Map) -> bool:
345345
for key in shared_keys:
346346
if old_cell[key] != new_cell[key]:
347347
value = new_cell[key]
348-
if key == "outputs" and value:
349-
# outputs require complex handling - some have Text type nested;
350-
# for now skip creating them; clearing all outputs is fine
348+
if (
349+
key == "outputs"
350+
and value
351+
and any(output.get("output_type") == "stream" for output in value)
352+
):
353+
# Outputs with stream require complex handling as they have
354+
# the Text type nested inside; for now skip creating them.
355+
# Clearing all outputs is fine.
351356
return False
352357

353358
if key in _CELL_KEY_TYPE_MAP:

0 commit comments

Comments
 (0)