jupyter / jupyter/nbclient

No way to make `execute` clean up client when `km` is passed

Open
#348 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
186
Forks
69
PR merge metrics
No merged PRs in 30d

Description

When passing `km=...` to `nbclient.execute`, it won’t clean up its kernel client.

`nbclient.NotebookClient.execute` passes its kwargs to `(async_)setup_kernel`, where `cleanup_kc` defaults to the value of `self.owns_km`.

But `nbclient.execute` has no way to pass `cleanup_kc` if you want `km` to spawn new kernels every time.

Contributor guide

Open the contributing guide

Research direction

Start by tracing nbclient.NotebookClient.execute and nbclient.execute into (async_)setup_kernel, focusing on how cleanup_kc is selected when km is supplied. Confirm the intended call path and add a way for callers passing km to request cleanup, then verify that the kernel client is cleaned up after execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.