callmephilipC
Deno14mo ago
6 replies
callmephilip

Deno + Jupyter - a couple of hiccups: jupyter execute and tests

First things first, Deno + Jupyter is amazing - kudos to the team.

A couple of things that did not work out for me which I would like some more context to understand and try to fix/report on.

I've originally reported on them here (https://github.com/rgbkrk/denotebooks/issues/8) and here (https://github.com/rgbkrk/denotebooks/issues/9).

jupyter execute fails for certain notebooks


Trying to run jupyter execute (e.g. jupyter execute --kernel_name=deno hello.ipynb) on some notebooks fails with the following error (more info: https://github.com/rgbkrk/denotebooks/issues/8):

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.10/x64/bin/jupyter-execute", line 8, in <module>
    [.........]
    line 1103, in process_message
    display_id = content.get("transient", {}).get("display_id", None)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'


tests inside notebooks


Failing tests inside notebooks do not cause actual runtime errors but simply print error output. This effectively means that when you run jupyter execute on a notebook, it exits normally instead of reporting an error

import { assert } from "jsr:@std/assert";

Deno.test("failing test", () => {
  assert(false);
});
Was this page helpful?