Skip to content

Fix crash when handling a stream after non-stream output#48

Merged
echarles merged 5 commits intodatalayer:mainfrom
krassowski:fix-cell-outputs
Jul 19, 2025
Merged

Fix crash when handling a stream after non-stream output#48
echarles merged 5 commits intodatalayer:mainfrom
krassowski:fix-cell-outputs

Conversation

@krassowski
Copy link
Collaborator

@krassowski krassowski commented Jul 18, 2025

  • Fixes Crash when executing a cell with an output which does not have a name #47
  • Add a failing test case (https://github.com/datalayer/jupyter-server-nbmodel/actions/runs/16378348322/job/46283712116#step:7:424):
    Traceback (most recent call last):
      File "/home/runner/work/jupyter-server-nbmodel/jupyter-server-nbmodel/jupyter_server_nbmodel/actions.py", line 276, in kernel_worker
        results[uid] = await _execute_snippet(
                       ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/jupyter-server-nbmodel/jupyter-server-nbmodel/jupyter_server_nbmodel/actions.py", line 213, in _execute_snippet
        reply = await ensure_async(
                ^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 197, in ensure_async
        result = await obj
                 ^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/jupyter_client/client.py", line 565, in _async_execute_interactive
        output_hook(msg)
      File "/home/runner/work/jupyter-server-nbmodel/jupyter-server-nbmodel/jupyter_server_nbmodel/actions.py", line 110, in _output_hook
        if (not cell_outputs) or (cell_outputs[-1]["name"] != output["name"]):
                                  ~~~~~~~~~~~~~~~~^^^^^^^^
    KeyError: 'name'
  • Add a fix

@krassowski krassowski added the bug Something isn't working label Jul 18, 2025
@github-actions
Copy link

Binder 👈 Launch a Binder on branch krassowski/jupyter-server-nbmodel/fix-cell-outputs

@krassowski krassowski mentioned this pull request Jul 18, 2025
@krassowski krassowski marked this pull request as ready for review July 18, 2025 13:00
@echarles
Copy link
Member

@krassowski Worth rebasing on #50 to get a green CI

@krassowski krassowski marked this pull request as draft July 18, 2025 15:36
@krassowski krassowski marked this pull request as ready for review July 18, 2025 19:21
@krassowski krassowski requested a review from echarles July 18, 2025 19:21
Copy link
Member

@echarles echarles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thx @krassowski

@echarles echarles merged commit 740c31d into datalayer:main Jul 19, 2025
6 checks passed
@krassowski krassowski deleted the fix-cell-outputs branch October 30, 2025 15:13
@krassowski krassowski restored the fix-cell-outputs branch November 10, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when executing a cell with an output which does not have a name

2 participants