Skip to content

Conversation

@lennartkats-db
Copy link
Contributor

@lennartkats-db lennartkats-db commented Oct 3, 2025

Changes

This updates the default-python template according to the latest Lakeflow conventions as established in #3671. Notably, the new template moves away from the use of notebooks for pipeline source code.

The new layout looks as follows when the user selects they want both the sample job and the sample pipeline:

📁 resources
├── sample_job.job.yml
└── sample_etl.pipeline.yml
📁 src
├── 📁 my_project — shared source code for use in jobs and/or pipelines
│ ├── __init__.py
│ └── main.py
└── 📁 my_project_etl — source code for the sample_etl pipeline
├── __init__.py
├── 📁 transformations
│ ├── __init__.py
│ ├── sample_zones_my_project.py
│ └── sample_trips_my_project.py
├── 📁 explorations — exploratory notebooks
│ ├── __init__.py
│ └── sample_exploration.ipynb
└── README.md
📁 tests — unit tests
📁 fixtures — fixtures (these can now be used with load_fixture)
databricks.yml
pyproject.toml
README.md

The template prompts have been updated to cater to this structure. Notably, they include a new prompt to manage the catalog and schema used by the template. These settings are propagated to both the job and the pipeline:

Welcome to the default Python template for Databricks Asset Bundles!

Answer the following questions to customize your project.
You can always change your configuration in the databricks.yml file later.

Note that https://e2-dogfood.staging.cloud.databricks.com is used for initialization.
(For information on how to change your profile, see https://docs.databricks.com/dev-tools/cli/profiles.html.)

Unique name for this project [my_project]: my_project
Include a Lakeflow job that runs a notebook: yes
Include an ETL pipeline: yes
Include a sample Python package that builds into a wheel file: yes
Use serverless compute: yes
Default catalog for any tables created by this project [main]: main
Use a personal schema for each user working on this project.
(This is recommended. Your personal schema will be 'main.lennart_kats'.): yes

✨ Your new project has been created in the 'my_project' directory!

To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html.

Testing

@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Oct 3, 2025

Run: 19064653887

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip
💚​ aws linux 1 1 326 591
💚​ aws windows 1 1 327 590
💚​ aws-ucws linux 1 1 449 486
💚​ aws-ucws windows 1 1 450 485
💚​ azure linux 1 1 326 590
💚​ azure windows 1 1 327 589
💚​ azure-ucws linux 1 1 445 485
💚​ azure-ucws windows 1 1 446 484
🔄​ gcp linux 8 1 1 317 592
🔄​ gcp windows 2 1 1 324 591
12 failing tests:
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/resources/jobs/fail-on-active-runs ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/resources/jobs/fail-on-active-runs/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/resources/pipelines/lakeflow-pipeline ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/resources/pipelines/lakeflow-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/resources/pipelines/update/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/resources/pipelines/update/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/run/app-with-job 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=yes ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=no ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct/UV_PYTHON=3.10 ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.9 ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f

@lennartkats-db lennartkats-db force-pushed the replace-default-python-template branch from 7415181 to 7b37662 Compare October 6, 2025 19:37
@lennartkats-db lennartkats-db force-pushed the replace-default-python-template branch from 2a8ea44 to 81371f2 Compare October 7, 2025 12:29
Base automatically changed from add-default-template to main October 13, 2025 08:09
@lennartkats-db lennartkats-db force-pushed the replace-default-python-template branch from ba4fa01 to 603fe28 Compare October 13, 2025 11:48
lennartkats-db and others added 6 commits November 2, 2025 20:23
Remove unused files (default-python now depends on ../default!)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…n-template

# Conflicts:
#	NEXT_CHANGELOG.md
#	acceptance/auth/bundle_and_profile/output.txt
#	acceptance/bundle/templates/default-python/classic/out.plan_prod.direct.json
#	acceptance/bundle/templates/default-python/integration_classic/output.txt
#	acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/resources/lakeflow_pipelines_etl.pipeline.yml
#	acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/resources/my_lakeflow_pipelines_etl.pipeline.yml
#	acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/src/lakeflow_pipelines_etl/README.md
#	acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/src/my_lakeflow_pipelines_etl/README.md
#	acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/resources/lakeflow_pipelines_etl.pipeline.yml
#	acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/resources/my_lakeflow_pipelines_etl.pipeline.yml
#	acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/src/lakeflow_pipelines_etl/README.md
#	acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/src/my_lakeflow_pipelines_etl/README.md
#	libs/template/template.go
#	libs/template/templates/default/template/__preamble.tmpl
#	libs/template/templates/experimental-default-python-vnext/databricks_template_schema.json
#	libs/template/templates/lakeflow-pipelines/databricks_template_schema.json
…ibility

This commit applies several critical fixes to the template system:

1. Non-UC workspace support (deeeb38): Set default_catalog to "hive_metastore"
   when no UC metastore is available, ensuring templates work on non-UC workspaces.
   Applied to default-python and lakeflow-pipelines templates.

2. Fix catalog property references (63758b4): Changed template conditionals from
   using the helper function `default_catalog` to the property `.default_catalog`
   in pipeline templates. This ensures proper evaluation of the user-provided value.

3. Serverless catalog field (0088b28): Always emit the catalog field for serverless
   pipelines, changing the comment to clarify that "Serverless compute requires
   Unity Catalog". Applied to both YAML and Python pipeline templates.

4. PyDABs compatibility: Added missing enable_pydabs property to default-python
   template schema to support the merged PyDABs infrastructure from main.

Acceptance test outputs have been updated to reflect these changes.
@lennartkats-db lennartkats-db force-pushed the replace-default-python-template branch from 0612af1 to fe7fca4 Compare November 3, 2025 10:54
lennartkats-db and others added 2 commits November 4, 2025 09:16
Integration tests were failing because when a UC workspace has no
metastore default catalog, the template would use "hive_metastore"
for serverless pipelines, which the API rejects.

Hardcode 'catalog: main' instead of '${var.catalog}' for this case.
This provides a clear error if "main" doesn't exist and matches the
approach used in origin/main.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@lennartkats-db lennartkats-db added this pull request to the merge queue Nov 4, 2025
Merged via the queue into main with commit eb0df9a Nov 4, 2025
13 checks passed
@lennartkats-db lennartkats-db deleted the replace-default-python-template branch November 4, 2025 10:41
deco-sdk-tagging bot added a commit that referenced this pull request Nov 5, 2025
## Release v0.276.0

### CLI
* Remove previously added flags from the `jobs create` and `pipelines create` commands. ([#3870](#3870))

### Bundles
* Updated the default-python template to follow the Lakeflow conventions: pipelines as source files, pyproject.toml ([#3712](#3712)).
* Fix a permissions bug adding second IS\_OWNER and causing "The job must have exactly one owner." error. Introduced in 0.274.0. ([#3850](#3850))
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.

6 participants