Skip to content

Conversation

@kanterov
Copy link
Collaborator

@kanterov kanterov commented Sep 2, 2025

Changes

Support reading both python and experimental.python configs. If both are set, their value should be equivalent.

After we introduce the python section into the CLI, it has to keep setting both python and experimental.python into the payload for backward compatibility. After that, Python code can start erroring out if experimental/python is set but not python because it means that users have an outdated CLI version.

See also #3540

Why

It's a step toward graduating python outside the experimental section.

Tests

Unit tests and existing acceptance tests

@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Sep 2, 2025

Run: 17405850493

Env ✅​pass 🔄​flaky 🙈​skip
🔄​ aws linux 305 3 511
✅​ aws windows 309 510
✅​ aws-ucws linux 420 409
🔄​ aws-ucws windows 418 3 408
✅​ azure linux 308 510
✅​ azure windows 309 509
✅​ azure-ucws linux 420 408
🔄​ azure-ucws windows 419 2 407
🔄​ gcp linux 303 4 512
✅​ gcp windows 308 511
9 failing tests:
Test Name aws linux aws-ucws windows azure-ucws windows gcp linux
TestAccept 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/pipeline/allow-duplicate-names ✅​pass 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/pipeline/allow-duplicate-names/DATABRICKS_CLI_DEPLOYMENT=direct-exp ✅​pass 🔄​flaky 🔄​flaky ✅​pass
TestAccept/bundle/deploy/pipeline/allow-duplicate-names/DATABRICKS_CLI_DEPLOYMENT=terraform ✅​pass ✅​pass 🔄​flaky ✅​pass
TestAccept/bundle/resources/pipelines/update 🔄​flaky ✅​pass ✅​pass 🔄​flaky
TestAccept/bundle/resources/pipelines/update/DATABRICKS_CLI_DEPLOYMENT=direct-exp ✅​pass ✅​pass ✅​pass 🔄​flaky
TestAccept/bundle/resources/pipelines/update/DATABRICKS_CLI_DEPLOYMENT=terraform 🔄​flaky ✅​pass ✅​pass ✅​pass
TestAccept/bundle/templates/default-python/integration_classic ✅​pass ✅​pass ✅​pass 🔄​flaky
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_CLI_DEPLOYMENT=terraform/UV_PYTHON=3.12 ✅​pass ✅​pass ✅​pass 🔄​flaky

@kanterov kanterov marked this pull request as ready for review September 2, 2025 14:52
return (
_Conf(),
Diagnostics.create_error(
"Both 'python' and 'experimental/python' sections are present, use 'python' section only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not have validation in CLI itself and keep Python part light? E.g. use 'python', fallback to 'experimental.python'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is CLI validation in #3540, but we can't assume that both have the latest version. So we are defensive on both ends.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is CLI validation in #3540, but we can't assume that both have the latest version.

Why not enforce minimum or exact databricks-bundles version in CLI?

Copy link
Collaborator Author

@kanterov kanterov Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is also ready to go now. We don't need to wait for the CLI release including support for non-experimental "python" section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For discussion: do you have ideas on how to enforce bidirectional compat for future changes? If so, do we use some kind of version range to do this? Some changes will require a coupled bump. It may be easier to just require version coupling, or at least warn if you're using different versions.

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks good.

Let's continue the discussion about the merits of version checks elsewhere.

@kanterov kanterov added this pull request to the merge queue Sep 8, 2025
Merged via the queue into main with commit d3ac142 Sep 8, 2025
19 checks passed
@kanterov kanterov deleted the python-read-both-configs branch September 8, 2025 10:45
pietern pushed a commit that referenced this pull request Oct 27, 2025
## Changes
Move `python` outside of the `experimental` section. 

The change is backward-compatible and forward-compatible. If CLI is
using a newer or older version of `databricks-bundles,` it will continue
to work. It's implemented by copying the content of `python` into
`experimental.python`. If we don't offer compatibility, there is a risk
that previously deployed resources will be erased because we wouldn't be
able to load resources.

See also #3539

## Why
Python support for Databricks Asset Bundles is graduating from the
experimental status.

## Tests
Acceptance tests check that previous `databricks-bundles` versions
continue to work.
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.

5 participants