Skip to content

Revert #5799 - #5837

Merged
janniklasrose merged 1 commit into
mainfrom
janniklasrose/revert-5799
Jul 6, 2026
Merged

Revert #5799#5837
janniklasrose merged 1 commit into
mainfrom
janniklasrose/revert-5799

Conversation

@janniklasrose

Copy link
Copy Markdown
Contributor

Changes

Revert "Download spark_python_task workspace files in bundle generate job (#5799)"

This reverts commit b2e7e6f.

Conflicts:
NEXT_CHANGELOG.md

Why

Python files/scripts often include other files, whereas notebooks are more commonly self-contained.

With the previous PR, jobs might randomly fail due to missing imports whereas before they would just work.

… job (#5799)"

This reverts commit b2e7e6f.

Conflicts:
	NEXT_CHANGELOG.md
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: a63ca11

Run: 28783267807

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 1 4 233 1056 3:58
💚​ aws windows 1 4 235 1054 4:14
💚​ aws-ucws linux 1 4 317 974 5:00
💚​ aws-ucws windows 1 4 319 972 4:02
💚​ azure linux 1 4 233 1055 4:18
🔄​ azure windows 2 1 4 233 1053 4:09
💚​ azure-ucws linux 1 4 319 971 5:23
💚​ azure-ucws windows 1 4 321 969 4:07
💚​ gcp linux 1 4 232 1057 3:51
💚​ gcp windows 1 4 234 1055 4:16
7 interesting tests: 4 SKIP, 2 flaky, 1 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestFsCpFileToDirFileNotOverwritten/dbfs_to_dbfs ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestFsCpFileToDirFileNotOverwritten/dbfs_to_local ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
Top 5 slowest tests (at least 2 minutes):
duration env testname
3:22 gcp windows TestAccept
3:19 aws windows TestAccept
3:11 aws-ucws windows TestAccept
3:07 azure-ucws windows TestAccept
2:51 azure windows TestAccept

@janniklasrose
janniklasrose added this pull request to the merge queue Jul 6, 2026
Merged via the queue into main with commit 353cb5a Jul 6, 2026
25 checks passed
@janniklasrose
janniklasrose deleted the janniklasrose/revert-5799 branch July 6, 2026 11:14
tanishgupta-db pushed a commit to tanishgupta-db/cli that referenced this pull request Jul 21, 2026
…thon-files flag (databricks#5892)

## Changes

Re-applies databricks#5799 (reverted in databricks#5837) and puts the behaviour behind a new
opt-in flag.

`bundle generate job` only downloaded notebook tasks; files referenced
by `spark_python_task` were left as absolute `/Workspace/...` paths, so
the source file was never downloaded and the config wasn't portable.
This PR restores the download+rewrite path (reusing the same
`markFileForDownload` helper as pipeline libraries) but gates it behind
a new `--download-spark-python-files` flag on `bundle generate job`,
defaulting to **off**. Git-sourced files (`source: GIT`) and cloud URIs
(`dbfs:/`, `s3:/`, `adls:/`, `gcs:/`) are left untouched.

The flag is threaded through the `Downloader` as a functional option
(`WithSparkPythonFiles`), so the pipeline, app, and import callers are
unaffected.

## Why

databricks#5799 was reverted in databricks#5837 because a Python file often imports sibling
files that the downloader does not capture, so downloading only the
entry point can produce a job that fails at runtime with missing imports
— whereas leaving the absolute workspace path alone "just works". Making
the download opt-in keeps the default safe while letting users who know
their `spark_python_task` is self-contained pull the file into their
bundle.

## Commits

1. **Re-apply databricks#5799** — a single re-revert of databricks#5837, restoring the
original change verbatim (only the `NEXT_CHANGELOG.md` conflict
resolved).
2. **Gate behind `--download-spark-python-files`** — the new flag,
functional-option plumbing, tests, and regenerated help/changelog.

## Tests

- Unit tests in `bundle/generate/downloader_test.go`: the
download+rewrite path (with the option), the skipped cases (cloud URI,
`source: GIT`), and a new test asserting the default-off behaviour makes
no requests.
- Acceptance test `acceptance/bundle/generate/spark_python_task_job`
exercising the full CLI with the flag: a workspace-file task is
downloaded and rewritten, a `dbfs:/` cloud-URI task is preserved.
Identical output on both `terraform` and `direct` engines.
- Regenerated the `bundle generate job --help` golden file.

This pull request and its description were written by Isaac, an AI
coding agent.
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.

3 participants