Uh oh!
There was an error while loading. Please reload this page.
Make DB Connect work out of the box for unit tests with the default-python template - #3254
Merged
Conversation
lennartkats-db
requested review from
andrewnester, anton-107, denik, pietern and shreyas-goenka
as code ownersJuly 15, 2025 07:55
lennartkats-dbtemporarily deployed
to
test-trigger-is
July 15, 2025 07:55 — with
GitHub Actions
Inactive
lennartkats-dbtemporarily deployed
to
test-trigger-is
July 15, 2025 08:05 — with
GitHub Actions
Inactive
pietern
reviewed
Jul 16, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
github-merge-queueBot
pushed a commit
that referenced
this pull request
Jul 16, 2025
## Changes A test failure in #3254 shows the Python scripts called from our acceptance tests were using `cp1252` encoding on Windows, which is incompatible with tests using UTF-8. This change makes these tests always use UTF-8. ## Tests Adds an emoji to the diff selftest.
lennartkats-dbtemporarily deployed
to
test-trigger-is
July 25, 2025 11:36 — with
GitHub Actions
Inactive
Collaborator
|
lennartkats-dbtemporarily deployed
to
test-trigger-is
August 1, 2025 08:57 — with
GitHub Actions
Inactive
lennartkats-dbtemporarily deployed
to
test-trigger-is
August 1, 2025 09:00 — with
GitHub Actions
Inactive
3 tasks
pietern
reviewed
Sep 1, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lennartkats-dbtemporarily deployed
to
test-trigger-is
September 1, 2025 10:33 — with
GitHub Actions
Inactive
lennartkats-dbforce-pushed
the
uv-db-connect
branch
from
September 1, 2025 11:04
6b8469d to
ae92d07Comparelennartkats-dbtemporarily deployed
to
test-trigger-is
September 1, 2025 11:04 — with
GitHub Actions
Inactive
lennartkats-dbtemporarily deployed
to
test-trigger-is
September 1, 2025 11:05 — with
GitHub Actions
Inactive
lennartkats-dbforce-pushed
the
uv-db-connect
branch
from
September 1, 2025 11:07
cf7009e to
ae92d07Comparelennartkats-dbtemporarily deployed
to
test-trigger-is
September 1, 2025 11:07 — with
GitHub Actions
Inactive
lennartkats-dbtemporarily deployed
to
test-trigger-is
September 2, 2025 09:19 — with
GitHub Actions
Inactive
lennartkats-dbtemporarily deployed
to
test-trigger-is
September 2, 2025 09:19 — with
GitHub Actions
Inactive
lennartkats-db
enabled auto-merge
September 2, 2025 09:23
pietern
approved these changes
Sep 2, 2025
Uh oh!
There was an error while loading. Please reload this page.
pietern
disabled auto-merge
September 2, 2025 09:41
lennartkats-dbtemporarily deployed
to
test-trigger-is
September 2, 2025 10:55 — with
GitHub Actions
Inactive
lennartkats-db
enabled auto-merge
September 2, 2025 10:56
Uh oh!
There was an error while loading. Please reload this page.
deco-sdk-taggingBot
added a commit
that referenced
this pull request
Sep 3, 2025
## Release v0.267.0 ### CLI * Introduce retries to `databricks psql` command ([#3492](#3492)) * Add rule files for coding agents working on the CLI code base ([#3245](#3245)) ### Dependency updates * Upgrade TF provider to 1.88.0 ([#3529](#3529)) * Upgrade Go SDK to 0.82.0 ### Bundles * Update default-python template to make DB Connect work out of the box for unit tests, using uv to install dependencies ([#3254](#3254)) * Add support for `TaskRetryMode` for continuous jobs ([#3529](#3529)) * Add support for specifying database instance as an application resource ([#3529](#3529)) * Allow referencing job libraries outside bundle root without the need to specify sync root ([#2842](#2842)) * Add top level `run_as` support for Lakeflow Declarative Pipelines ([#3307](#3307))
denik pushed a commit
that referenced
this pull request
May 20, 2026
## Changes A test failure in #3254 shows the Python scripts called from our acceptance tests were using `cp1252` encoding on Windows, which is incompatible with tests using UTF-8. This change makes these tests always use UTF-8. ## Tests Adds an emoji to the diff selftest.
denik pushed a commit
that referenced
this pull request
May 20, 2026
…ython template (#3254) ## Changes This update `default-python` to make DB Connect work out of the box: * We now install a conservative 15.x version of DB Connect using uv (14.x is even older and doesn't support serverless) * We validate that the current DB Connect version is supported by the remote cluster / serverless compute. Note that the VS Code extension also does this, providing a warning when users attempt to run against an older cluster. * We make sure there's always a valid SparkSession during test execution (even when users write standard Spark / Spark Declarative Pipelines code with `SparkSessions.builder.getOrCreate()`) * We fall back to serverless compute when the user didn't manually configure a cluster. This also addresses known a current issue with the VS Code extension where it doesn't provide a cluster id when using 'Run' rather than 'Debug' to execute unit tests. * We validate that test dependencies are installed and report a friendly error if they are not. ## Usage 1. Install via `bundle init` ``` lennart:demo$ databricks bundle init Template to use: python-default Welcome to the default Python template for Databricks Asset Bundles! Please provide the following details to tailor the template to your preferences. Unique name for this project [my_project]: my_project Include a stub (sample) notebook in 'my_project/src': yes Include a stub (sample) Delta Live Tables pipeline in 'my_project/src': yes Include a stub (sample) Python package in 'my_project/src': yes Use serverless compute: yes Workspace to use (auto-detected, edit in 'my_project/databricks.yml'): https://[workspace].databricks.com ✨ Your new project has been created in the 'my_project' directory! Please refer to the README.md file for "getting started" instructions. See also the documentation at https://docs.databricks.com/dev-tools/bundles/index.html. lennart:demo$ cd my_project ``` 2. Run tests with `pytest` ``` lennart:my_project$ pytest ImportError while loading conftest '/private/tmp/demp/my_project/conftest.py'. conftest.py:17: in <module> raise ImportError( E ImportError: Test dependencies not found. E E Run tests using 'uv run pytest'. See http://docs.astral.sh/uv to learn move about uv. ``` 3. Actually, Step 2 was wrong. Run tests using `uv`. Or from the VS Code extension. ``` lennart:my_project$ uv run pytest Using CPython 3.13.3 interpreter at: /opt/homebrew/opt/python@3.13/bin/python3.13 Creating virtual environment at: .venv Built my-project @ file:///private/tmp/demo/my_project Installed 32 packages in 235ms ☁️ no compute specified, falling back to serverless compute see https://docs.databricks.com/dev-tools/databricks-connect/cluster-config for manual configuration == test session starts == platform darwin -- Python 3.13.3, pytest-8.4.1, pluggy-1.6.0 rootdir: /private/tmp/demo/my_project configfile: pyproject.toml testpaths: tests collected 1 item tests/main_test.py . [100%] == 1 passed in 1.71s == ``` ## Why Manually setting up testing with DB Connect is still rather hard. With these changes, uv can be used to setup testing automatically. ## Tests * Acceptance tests * Manual tests from CLI, Cursor, different versions of DB Connect <!-- How have you tested the changes? --> <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
denik pushed a commit
that referenced
this pull request
May 20, 2026
## Release v0.267.0 ### CLI * Introduce retries to `databricks psql` command ([#3492](#3492)) * Add rule files for coding agents working on the CLI code base ([#3245](#3245)) ### Dependency updates * Upgrade TF provider to 1.88.0 ([#3529](#3529)) * Upgrade Go SDK to 0.82.0 ### Bundles * Update default-python template to make DB Connect work out of the box for unit tests, using uv to install dependencies ([#3254](#3254)) * Add support for `TaskRetryMode` for continuous jobs ([#3529](#3529)) * Add support for specifying database instance as an application resource ([#3529](#3529)) * Allow referencing job libraries outside bundle root without the need to specify sync root ([#2842](#2842)) * Add top level `run_as` support for Lakeflow Declarative Pipelines ([#3307](#3307))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This update
default-pythonto make DB Connect work out of the box:SparkSessions.builder.getOrCreate())Usage
bundle initpytestuv. Or from the VS Code extension.Why
Manually setting up testing with DB Connect is still rather hard. With these changes, uv can be used to setup testing automatically.
Tests