Skip to content

Commit a5b6768

Browse files
committed
jupyter - warn on cells with no output and execute: false (#10575)
1 parent efef4d7 commit a5b6768

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/execute/jupyter/jupyter.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ import { runExternalPreviewServer } from "../../preview/preview-server.ts";
111111
import { onCleanup } from "../../core/cleanup.ts";
112112
import { projectOutputDir } from "../../project/project-shared.ts";
113113
import { assert } from "testing/asserts";
114+
import { warn } from "log";
114115

115116
export const jupyterEngine: ExecutionEngine = {
116117
name: kJupyterEngine,
@@ -379,6 +380,12 @@ export const jupyterEngine: ExecutionEngine = {
379380

380381
const nb = jupyterFromJSON(nbContents);
381382

383+
if (!execute && nb.cells.some((cell) => cell.execution_count === null)) {
384+
// warn users that the notebook was not executed
385+
warn(
386+
`${options.target.input} contains unexecuted code cells. Use 'execute: true' to execute the notebook.`,
387+
);
388+
}
382389
// cells tagged 'shinylive' should be emmited as markdown
383390
fixupShinyliveCodeCells(nb);
384391

0 commit comments

Comments
 (0)