Skip to content

Normalize notebook cell source before wrapping jobs - #2143

Merged
rugpanov merged 1 commit into
databricks:mainfrom
Hashim1999164:fix/ipynb-cell-source-string
Sep 2, 2026
Merged

Normalize notebook cell source before wrapping jobs#2143
rugpanov merged 1 commit into
databricks:mainfrom
Hashim1999164:fix/ipynb-cell-source-string

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Changes

Run as Databricks Job crashed when an ipynb cell source was a JSON string. Nbformat allows a string or a list. The wrapper now normalizes source to lines before calling flatMap.

Fixes #2142

Tests

Added a unit test with a string cell source next to the existing list source wrap test.

@rugpanov

Copy link
Copy Markdown
Contributor

Thanks for the fix, @Hashim1999164 — this is a real bug and the change looks good (normalizing source to a list before flatMap is the right call, and the added test covers it well).

Before we can merge, external contributions to this repo need a signed Contributor License Agreement (CLA). It's a one-time agreement confirming you have the right to submit this contribution and granting Databricks permission to distribute it under the project's license — it's about licensing, not your code, and once signed it also covers any future contributions from you.

Two quick things so we can get it to you:

  1. Are you ready/willing to sign the CLA? (If you're contributing on behalf of a company, it may need sign-off from someone authorized there, so it's worth flagging early.)
  2. Could you share the real name and email we should put on the agreement? Your commit is currently authored under GitHub's private no-reply address (64767361+Hashim1999164@users.noreply.github.com), so we need a real name/email to send you the CLA.

Once you confirm, I'll have our legal team send over the CLA. After it's signed and returned, we'll get this merged. Thanks again!

@Hashim1999164

Copy link
Copy Markdown
Contributor Author

Yes, I am ready to sign the CLA. I am contributing as an individual, not on behalf of a company.

Name: Hashim Khan
Email: sardarhashim30@gmail.com

Please send the CLA to that email. I will sign it when it arrives.

@Hashim1999164
Hashim1999164 deployed to test-trigger-is August 25, 2026 09:09 — with GitHub Actions Active
@Hashim1999164

Copy link
Copy Markdown
Contributor Author

@rugpanov Just checking in on the CLA email. I am still ready to sign as an individual. Please send it to sardarhashim30@gmail.com whenever it is ready.

@rugpanov

rugpanov commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hi @Hashim1999164 , our legal team has sent you the CLA.

@Hashim1999164

Copy link
Copy Markdown
Contributor Author

@rugpanov I signed the CLA in DocuSign just now and returned it. Please let me know if legal still needs anything else.

@rugpanov
rugpanov force-pushed the fix/ipynb-cell-source-string branch from 36fa587 to af436a5 Compare September 1, 2026 16:26
@rugpanov
rugpanov deployed to test-trigger-is September 1, 2026 16:26 — with GitHub Actions Active
@rugpanov
rugpanov force-pushed the fix/ipynb-cell-source-string branch from af436a5 to f897790 Compare September 2, 2026 09:01
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2143
  • Commit SHA: f897790855e038feb305ebb801a06b9875db8e1d

Checks will be approved automatically on success.

@rugpanov
rugpanov deployed to test-trigger-is September 2, 2026 09:10 — with GitHub Actions Active
@rugpanov

rugpanov commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Thanks so much for this fix, @Hashim1999164 🙏

Nice catch and a clean, well-scoped fix — normalizing source to a list before flatMap correctly handles the case where an .ipynb cell's source is a JSON string rather than an array (both are valid per nbformat), and the added unit test covers it nicely.

I've rebased it onto the latest main and the integration tests are green. Merging now. Thank you for contributing to the Databricks extension for VSCode — hope to see more from you! 🎉

@rugpanov
rugpanov merged commit 3b8a4dd into databricks:main Sep 2, 2026
6 of 9 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 3, 2026
rugpanov added a commit that referenced this pull request Sep 3, 2026
Release **v2.16.0** of the Databricks VS Code extension.

Tracking: DECO-28403

## packages/databricks-vscode

- Add a manual mode to opt out of automated Python environment (uv)
setup (#2158)
-   Offer a one-click "Install uv" action when uv is missing (#2162)
- Prompt re-login on setup-local session expiry instead of a hard error
(#2163)
- Normalize notebook cell source before wrapping jobs, fixing "Run as
Databricks Job" when a cell's source is a JSON string (#2143) — reported
in #2142
- Update Databricks CLI to v1.14.1 (#2160) — see the [CLI release
notes](https://github.com/databricks/cli/releases) for changes

_Changelog curated: internal refactor (#2148) and CI/test-only changes
(#2165, #2141) omitted; auto-close issue refs stripped._

---------

Co-authored-by: releasebot <noreply@github.com>
Co-authored-by: @rugpanov <gripanov@gmail.com>
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.

[BUG] Run as Databricks Job fails with "_a18.flatMap is not a function" when a notebook cell's source is a JSON string instead of a list

2 participants