-
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
This code assumes that all cell outputs have a name
:
jupyter-server-nbmodel/jupyter_server_nbmodel/actions.py
Lines 110 to 112 in b99f3c5
if (not cell_outputs) or (cell_outputs[-1]["name"] != output["name"]): | |
output["text"] = [text] | |
cell_outputs.append(output) |
Reproduce
- Create the following cell
import matplotlib.pyplot as plt
plt.figure()
plt.show()
print('test')
- Attempt to run it
- See error:
[E 2025-07-18 11:20:18.050 ServerApp.jupyter_server_nb_model] Failed to process execution request 3698140a-5d25-4032-8799-bdf14c19d8bd for kernel e83b630e-ff21-48e2-b57c-210be95502aa.
Traceback (most recent call last):
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_nbmodel/handlers.py", line 324, in _kernel_worker
results[uid] = await _execute_snippet(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_nbmodel/handlers.py", line 263, in _execute_snippet
reply = await ensure_async(
^^^^^^^^^^^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 197, in ensure_async
result = await obj
^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_client/client.py", line 565, in _async_execute_interactive
output_hook(msg)
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_nbmodel/handlers.py", line 156, in _output_hook
if (not cell_outputs) or (cell_outputs[-1]["name"] != output["name"]):
~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'name'
Expected behavior
No crash
Context
This code will need a fix regardless of #43.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working