Skip to content

Forward cleanup_kc through execute#350

Draft
sapunyangkut wants to merge 1 commit into
jupyter:mainfrom
sapunyangkut:codex/issue-348-cleanup-kc
Draft

Forward cleanup_kc through execute#350
sapunyangkut wants to merge 1 commit into
jupyter:mainfrom
sapunyangkut:codex/issue-348-cleanup-kc

Conversation

@sapunyangkut

Copy link
Copy Markdown

Summary

  • add an explicit cleanup_kc option to the top-level execute convenience function
  • forward that option to NotebookClient.execute instead of the constructor
  • preserve the existing cleanup default when the option is omitted or None
  • add regression coverage for an externally supplied kernel manager

Root cause

The convenience wrapper accepted cleanup_kc through **kwargs, so it passed the option to NotebookClient(...). cleanup_kc belongs to execution, not construction, and Traitlets rejected it before execution began.

Impact

Callers that provide a kernel manager can now explicitly request or suppress cleanup through the convenience API. Existing calls keep their current ownership-based default.

AI disclosure

🤖🍆 This change and pull request description were prepared with OpenAI Codex-assisted automation. Codex modified nbclient/client.py and tests/test_client.py for this contribution.

Fixes #348.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant