Skip to content

Commit

Permalink
Fix stream output
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Dec 2, 2024
1 parent 5de54c8 commit dd6987c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jupyter_ydoc/ynotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ def create_ycell(self, value: Dict[str, Any]) -> Map:
outputs = cell.get("outputs", [])
for idx, output in enumerate(outputs):
if output.get("output_type") == "stream":
output["text"] = Array(output.get("text", []))
text = output.get("text", "")
if isinstance(text, str):
ytext = Text(text)
else:
ytext = Text("".join(text))
output["text"] = ytext
outputs[idx] = Map(output)
cell["outputs"] = Array(outputs)
cell["execution_state"] = "idle"
Expand Down

0 comments on commit dd6987c

Please sign in to comment.