Skip to content

fix(convert): omit execution count from markdown cells - #431

Merged
jamesbhobbs merged 2 commits into
deepnote:mainfrom
ANSHUL-REAL:fix/jupyter-markdown-execution-count
Aug 13, 2026
Merged

jamesbhobbs merged 2 commits into
deepnote:mainfrom
ANSHUL-REAL:fix/jupyter-markdown-execution-count

Conversation

@ANSHUL-REAL

@ANSHUL-REAL ANSHUL-REAL commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Omit execution_count from exported markdown cells.
  • Preserve execution_count for code cells, including null when a code block has not run.
  • Add a regression assertion for markdown conversion.

Root cause

convertBlockToJupyterCell added execution_count to every exported cell. That field is not valid on nbformat markdown cells, so converted notebooks could fail validation or gain unnecessary round-trip changes.

Validation

  • corepack pnpm --filter @deepnote/convert exec vitest run src/deepnote-to-jupyter.test.ts
  • corepack pnpm exec biome check --formatter-enabled=false packages/convert/src/deepnote-to-jupyter.ts packages/convert/src/deepnote-to-jupyter.test.ts

Fixes #430.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Jupyter export compatibility by omitting execution counts from markdown cells.
    • Code cells continue to include execution count information when applicable.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

convertBlockToJupyterCell now adds execution_count only when converting code cells. Markdown cells omit the property entirely. The markdown conversion test now verifies that execution_count is absent.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Updates Docs ⚠️ Warning Only src/test files changed; no docs were updated in this repo for the new conversion behavior. Please update the relevant docs in deepnote/deepnote OSS; if this needs roadmap text, also update the landing page in the private deepnote/deepnote-internal repo.
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses #430 by omitting execution_count on non-code cells while keeping code-cell handling intact.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to the conversion fix and its regression test.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: markdown cells no longer include execution_count during conversion.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ANSHUL-REAL
ANSHUL-REAL marked this pull request as ready for review July 24, 2026 08:47
@ANSHUL-REAL
ANSHUL-REAL requested a review from a team as a code owner July 24, 2026 08:47
@jamesbhobbs
jamesbhobbs merged commit ddda8de into deepnote:main Aug 13, 2026
19 checks passed
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.

convert: .deepnote → .ipynb emits execution_count: null on markdown cells (invalid nbformat)

2 participants