Skip to content

[Python] Support non-experimental conf in Python code - #3539

Merged
kanterov merged 1 commit into
mainfrom
python-read-both-configs
Sep 8, 2025
Merged

[Python] Support non-experimental conf in Python code#3539
kanterov merged 1 commit into
mainfrom
python-read-both-configs

Conversation

@kanterov

@kanterovkanterov commented Sep 2, 2025

Copy link
Copy Markdown
Collaborator

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

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

Copy link
Copy Markdown
Collaborator

Run: 17405850493

Env✅​pass🔄​flaky🙈​skip
🔄​aws linux3053511
✅​aws windows309510
✅​aws-ucws linux420409
🔄​aws-ucws windows4183408
✅​azure linux308510
✅​azure windows309509
✅​azure-ucws linux420408
🔄​azure-ucws windows4192407
🔄​gcp linux3034512
✅​gcp windows308511
9 failing tests:
Test Nameaws linuxaws-ucws windowsazure-ucws windowsgcp 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
Copy Markdown
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
Copy Markdown
CollaboratorAuthor

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
Copy Markdown
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?

@kanterovkanterovSep 8, 2025

Copy link
Copy Markdown
CollaboratorAuthor

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
Copy Markdown
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.

@pieternpietern left a comment

Copy link
Copy Markdown
Contributor

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 queueSep 8, 2025
Merged via the queue into main with commit d3ac142Sep 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.
denik pushed a commit that referenced this pull request May 20, 2026
## 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
denik pushed a commit that referenced this pull request May 20, 2026
## 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 freeto 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.

4 participants

@kanterov@eng-dev-ecosystem-bot@pietern@denik