From aa5cdb2d8e7e925af32939997f690cfb6026fd61 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Sun, 12 Jul 2026 23:49:48 +0200 Subject: [PATCH 01/17] Make bundle command error more actionable if run without databricks.yml --- acceptance/bundle/run/inline-script/no-bundle/output.txt | 2 +- acceptance/bundle/run/inline-script/no-separator/output.txt | 2 +- bundle/root.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/run/inline-script/no-bundle/output.txt b/acceptance/bundle/run/inline-script/no-bundle/output.txt index 870f682634f..4c41b8e366d 100644 --- a/acceptance/bundle/run/inline-script/no-bundle/output.txt +++ b/acceptance/bundle/run/inline-script/no-bundle/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle run -- echo hello -Error: unable to locate bundle root: databricks.yml not found +Error: unable to locate bundle root: databricks.yml not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one Exit code: 1 diff --git a/acceptance/bundle/run/inline-script/no-separator/output.txt b/acceptance/bundle/run/inline-script/no-separator/output.txt index 7a35cab72e4..937988ce833 100644 --- a/acceptance/bundle/run/inline-script/no-separator/output.txt +++ b/acceptance/bundle/run/inline-script/no-separator/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle run echo hello -Error: unable to locate bundle root: databricks.yml not found +Error: unable to locate bundle root: databricks.yml not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one Exit code: 1 diff --git a/bundle/root.go b/bundle/root.go index 9ea9a8c13fe..9f6f2c5f6bb 100644 --- a/bundle/root.go +++ b/bundle/root.go @@ -45,7 +45,7 @@ func getRootWithTraversal() (string, error) { } } - return "", fmt.Errorf(`unable to locate bundle root: %s not found`, config.FileNames[0]) + return "", fmt.Errorf(`unable to locate bundle root: %s not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one`, config.FileNames[0]) } // mustGetRoot returns a bundle root or an error if one cannot be found. From 3e1e3946a480f9f319cb29aff0d7261833d650f5 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Sun, 12 Jul 2026 23:50:30 +0200 Subject: [PATCH 02/17] Add skeleton template --- acceptance/bundle/help/bundle-init/output.txt | 1 + .../bundle/templates/skeleton/input.json | 3 +++ .../bundle/templates/skeleton/out.test.toml | 3 +++ .../bundle/templates/skeleton/output.txt | 26 +++++++++++++++++++ .../output/my_skeleton/databricks.yml | 16 ++++++++++++ .../output/my_skeleton/resources/.gitkeep | 2 ++ acceptance/bundle/templates/skeleton/script | 12 +++++++++ libs/template/template.go | 7 +++++ libs/template/template_test.go | 3 +++ .../skeleton/databricks_template_schema.json | 14 ++++++++++ .../{{.project_name}}/databricks.yml.tmpl | 16 ++++++++++++ .../{{.project_name}}/resources/.gitkeep | 2 ++ 12 files changed, 105 insertions(+) create mode 100644 acceptance/bundle/templates/skeleton/input.json create mode 100644 acceptance/bundle/templates/skeleton/out.test.toml create mode 100644 acceptance/bundle/templates/skeleton/output.txt create mode 100644 acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml create mode 100644 acceptance/bundle/templates/skeleton/output/my_skeleton/resources/.gitkeep create mode 100644 acceptance/bundle/templates/skeleton/script create mode 100644 libs/template/templates/skeleton/databricks_template_schema.json create mode 100644 libs/template/templates/skeleton/template/{{.project_name}}/databricks.yml.tmpl create mode 100644 libs/template/templates/skeleton/template/{{.project_name}}/resources/.gitkeep diff --git a/acceptance/bundle/help/bundle-init/output.txt b/acceptance/bundle/help/bundle-init/output.txt index dad5e198e4c..aedee05b4f9 100644 --- a/acceptance/bundle/help/bundle-init/output.txt +++ b/acceptance/bundle/help/bundle-init/output.txt @@ -6,6 +6,7 @@ TEMPLATE_PATH optionally specifies which template to use. It can be one of the f - default-python: The default Python template for Notebooks and Lakeflow - default-sql: The default SQL template for .sql files that run with Databricks SQL - default-minimal: The minimal template, for advanced users +- skeleton: A bare bundle with just a databricks.yml and an empty resources directory - default-scala: The default Scala template for JAR jobs - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks) - mlops-stacks: The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks) diff --git a/acceptance/bundle/templates/skeleton/input.json b/acceptance/bundle/templates/skeleton/input.json new file mode 100644 index 00000000000..6734f26069d --- /dev/null +++ b/acceptance/bundle/templates/skeleton/input.json @@ -0,0 +1,3 @@ +{ + "project_name": "my_skeleton" +} diff --git a/acceptance/bundle/templates/skeleton/out.test.toml b/acceptance/bundle/templates/skeleton/out.test.toml new file mode 100644 index 00000000000..f784a183258 --- /dev/null +++ b/acceptance/bundle/templates/skeleton/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/bundle/templates/skeleton/output.txt b/acceptance/bundle/templates/skeleton/output.txt new file mode 100644 index 00000000000..6d89a27bc13 --- /dev/null +++ b/acceptance/bundle/templates/skeleton/output.txt @@ -0,0 +1,26 @@ + +>>> [CLI] bundle init skeleton --config-file ./input.json --output-dir output + +Welcome to the skeleton template for Declarative Automation Bundles! + +This template creates a bare-bones bundle with just a databricks.yml and an empty +resources/ directory, ready for you to add your own jobs, pipelines, and other resources. + +A workspace was selected based on your current profile. For information about how to +change this, see https://docs.databricks.com/dev-tools/cli/profiles.html. +workspace_host: [DATABRICKS_URL] + +✨ Your new project has been created in the 'my_skeleton' directory! + +Add resource definitions under my_skeleton/resources/, then deploy with: + cd my_skeleton + databricks bundle deploy + +>>> [CLI] bundle validate -t dev +Name: my_skeleton +Target: dev +Workspace: + User: [USERNAME] + Path: /Workspace/Users/[USERNAME]/.bundle/my_skeleton/dev + +Validation OK! diff --git a/acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml b/acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml new file mode 100644 index 00000000000..33d2c8c3414 --- /dev/null +++ b/acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml @@ -0,0 +1,16 @@ +# This is a Databricks asset bundle definition for my_skeleton. +# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. +bundle: + name: my_skeleton + +include: + - resources/*.yml + +targets: + # The 'dev' target is the default target. It uses 'mode: development' to create + # development copies: deployed resources get prefixed with '[dev my_user_name]' + # and any schedules and triggers are paused by default. + # See https://docs.databricks.com/dev-tools/bundles/deployment-modes.html. + dev: + mode: development + default: true diff --git a/acceptance/bundle/templates/skeleton/output/my_skeleton/resources/.gitkeep b/acceptance/bundle/templates/skeleton/output/my_skeleton/resources/.gitkeep new file mode 100644 index 00000000000..5b0d6b6f74b --- /dev/null +++ b/acceptance/bundle/templates/skeleton/output/my_skeleton/resources/.gitkeep @@ -0,0 +1,2 @@ + +This folder is reserved for Declarative Automation Bundles resource definitions. diff --git a/acceptance/bundle/templates/skeleton/script b/acceptance/bundle/templates/skeleton/script new file mode 100644 index 00000000000..031348292aa --- /dev/null +++ b/acceptance/bundle/templates/skeleton/script @@ -0,0 +1,12 @@ +trace $CLI bundle init skeleton --config-file ./input.json --output-dir output + +cd output/my_skeleton + +# Verify that the empty resources directory is preserved +[ -d "resources" ] || exit 1 + +trace $CLI bundle validate -t dev + +rm -r .databricks + +cd ../../ diff --git a/libs/template/template.go b/libs/template/template.go index b8448936bea..736f1bb7c0b 100644 --- a/libs/template/template.go +++ b/libs/template/template.go @@ -26,6 +26,7 @@ type TemplateName string const ( DefaultPython TemplateName = "default-python" DefaultMinimal TemplateName = "default-minimal" + Skeleton TemplateName = "skeleton" DefaultScala TemplateName = "default-scala" ExperimentalDefaultPython TemplateName = "experimental-default-python-vnext" DefaultSql TemplateName = "default-sql" @@ -59,6 +60,12 @@ var databricksTemplates = []Template{ Reader: &builtinReader{name: string(DefaultMinimal)}, Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: DefaultMinimal}}, }, + { + name: Skeleton, + description: "A bare bundle with just a databricks.yml and an empty resources directory", + Reader: &builtinReader{name: string(Skeleton)}, + Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: Skeleton}}, + }, { name: DefaultScala, description: "The default Scala template for JAR jobs", diff --git a/libs/template/template_test.go b/libs/template/template_test.go index 4692f0acb2a..c3319703bbc 100644 --- a/libs/template/template_test.go +++ b/libs/template/template_test.go @@ -11,6 +11,7 @@ func TestTemplateHelpDescriptions(t *testing.T) { expected := `- default-python: The default Python template for Notebooks and Lakeflow - default-sql: The default SQL template for .sql files that run with Databricks SQL - default-minimal: The minimal template, for advanced users +- skeleton: A bare bundle with just a databricks.yml and an empty resources directory - default-scala: The default Scala template for JAR jobs - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks) - mlops-stacks: The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks) @@ -23,6 +24,7 @@ func TestTemplateOptions(t *testing.T) { {Name: "default-python", Id: "The default Python template for Notebooks and Lakeflow"}, {Name: "default-sql", Id: "The default SQL template for .sql files that run with Databricks SQL"}, {Name: "default-minimal", Id: "The minimal template, for advanced users"}, + {Name: "skeleton", Id: "A bare bundle with just a databricks.yml and an empty resources directory"}, {Name: "default-scala", Id: "The default Scala template for JAR jobs"}, {Name: "dbt-sql", Id: "The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks)"}, {Name: "mlops-stacks", Id: "The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks)"}, @@ -58,6 +60,7 @@ func TestTemplateGetDatabricksTemplate(t *testing.T) { names := []TemplateName{ DefaultPython, DefaultMinimal, + Skeleton, DefaultScala, DefaultSql, DbtSql, diff --git a/libs/template/templates/skeleton/databricks_template_schema.json b/libs/template/templates/skeleton/databricks_template_schema.json new file mode 100644 index 00000000000..6d0a73e6f5c --- /dev/null +++ b/libs/template/templates/skeleton/databricks_template_schema.json @@ -0,0 +1,14 @@ +{ + "welcome_message": "\nWelcome to the skeleton template for Declarative Automation Bundles!\n\nThis template creates a bare-bones bundle with just a databricks.yml and an empty\nresources/ directory, ready for you to add your own jobs, pipelines, and other resources.\n\nA workspace was selected based on your current profile. For information about how to\nchange this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}", + "properties": { + "project_name": { + "type": "string", + "default": "my_bundle", + "description": "\nUnique name for this project.\nproject_name", + "order": 1, + "pattern": "^[A-Za-z0-9_]+$", + "pattern_match_failure_message": "Name must consist of letters, numbers, and underscores." + } + }, + "success_message": "\n✨ Your new project has been created in the '{{.project_name}}' directory!\n\nAdd resource definitions under {{.project_name}}/resources/, then deploy with:\n cd {{.project_name}}\n databricks bundle deploy" +} diff --git a/libs/template/templates/skeleton/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/skeleton/template/{{.project_name}}/databricks.yml.tmpl new file mode 100644 index 00000000000..b9e16dfda85 --- /dev/null +++ b/libs/template/templates/skeleton/template/{{.project_name}}/databricks.yml.tmpl @@ -0,0 +1,16 @@ +# This is a Databricks asset bundle definition for {{.project_name}}. +# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. +bundle: + name: {{.project_name}} + +include: + - resources/*.yml + +targets: + # The 'dev' target is the default target. It uses 'mode: development' to create + # development copies: deployed resources get prefixed with '[dev my_user_name]' + # and any schedules and triggers are paused by default. + # See https://docs.databricks.com/dev-tools/bundles/deployment-modes.html. + dev: + mode: development + default: true diff --git a/libs/template/templates/skeleton/template/{{.project_name}}/resources/.gitkeep b/libs/template/templates/skeleton/template/{{.project_name}}/resources/.gitkeep new file mode 100644 index 00000000000..5b0d6b6f74b --- /dev/null +++ b/libs/template/templates/skeleton/template/{{.project_name}}/resources/.gitkeep @@ -0,0 +1,2 @@ + +This folder is reserved for Declarative Automation Bundles resource definitions. From 8ebebb241edd7e8fa637ba343409b644c21e8869 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Sun, 12 Jul 2026 23:50:43 +0200 Subject: [PATCH 03/17] Add nextchanges entry --- .nextchanges/bundles/skeleton-template.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nextchanges/bundles/skeleton-template.md diff --git a/.nextchanges/bundles/skeleton-template.md b/.nextchanges/bundles/skeleton-template.md new file mode 100644 index 00000000000..b43e5fe9a2b --- /dev/null +++ b/.nextchanges/bundles/skeleton-template.md @@ -0,0 +1 @@ +Added a `skeleton` bundle template that scaffolds a bare `databricks.yml` and an empty `resources/` directory. Use it with `databricks bundle init skeleton` to start a new bundle without any sample code. From c67b8cbf40dc1b73f70223b312d90e0647c81ca5 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Jul 2026 14:11:35 +0200 Subject: [PATCH 04/17] rename skeleton to empty Co-authored-by: Isaac --- .nextchanges/bundles/empty-template.md | 1 + .nextchanges/bundles/skeleton-template.md | 1 - acceptance/bundle/help/bundle-init/output.txt | 2 +- acceptance/bundle/templates/empty/input.json | 3 +++ .../templates/{skeleton => empty}/out.test.toml | 0 .../templates/{skeleton => empty}/output.txt | 14 +++++++------- .../output/my_empty}/databricks.yml | 4 ++-- .../output/my_empty}/resources/.gitkeep | 0 .../bundle/templates/{skeleton => empty}/script | 4 ++-- acceptance/bundle/templates/skeleton/input.json | 3 --- libs/template/template.go | 8 ++++---- libs/template/template_test.go | 6 +++--- .../databricks_template_schema.json | 2 +- .../template/{{.project_name}}/databricks.yml.tmpl | 0 .../template/{{.project_name}}/resources/.gitkeep | 0 15 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 .nextchanges/bundles/empty-template.md delete mode 100644 .nextchanges/bundles/skeleton-template.md create mode 100644 acceptance/bundle/templates/empty/input.json rename acceptance/bundle/templates/{skeleton => empty}/out.test.toml (100%) rename acceptance/bundle/templates/{skeleton => empty}/output.txt (55%) rename acceptance/bundle/templates/{skeleton/output/my_skeleton => empty/output/my_empty}/databricks.yml (85%) rename acceptance/bundle/templates/{skeleton/output/my_skeleton => empty/output/my_empty}/resources/.gitkeep (100%) rename acceptance/bundle/templates/{skeleton => empty}/script (60%) delete mode 100644 acceptance/bundle/templates/skeleton/input.json rename libs/template/templates/{skeleton => empty}/databricks_template_schema.json (56%) rename libs/template/templates/{skeleton => empty}/template/{{.project_name}}/databricks.yml.tmpl (100%) rename libs/template/templates/{skeleton => empty}/template/{{.project_name}}/resources/.gitkeep (100%) diff --git a/.nextchanges/bundles/empty-template.md b/.nextchanges/bundles/empty-template.md new file mode 100644 index 00000000000..96a01a08b2f --- /dev/null +++ b/.nextchanges/bundles/empty-template.md @@ -0,0 +1 @@ +Added an `empty` bundle template that scaffolds a bare `databricks.yml` and an empty `resources/` directory. Use it with `databricks bundle init empty` to start a new bundle without any sample code. diff --git a/.nextchanges/bundles/skeleton-template.md b/.nextchanges/bundles/skeleton-template.md deleted file mode 100644 index b43e5fe9a2b..00000000000 --- a/.nextchanges/bundles/skeleton-template.md +++ /dev/null @@ -1 +0,0 @@ -Added a `skeleton` bundle template that scaffolds a bare `databricks.yml` and an empty `resources/` directory. Use it with `databricks bundle init skeleton` to start a new bundle without any sample code. diff --git a/acceptance/bundle/help/bundle-init/output.txt b/acceptance/bundle/help/bundle-init/output.txt index aedee05b4f9..5c6a03ccd3a 100644 --- a/acceptance/bundle/help/bundle-init/output.txt +++ b/acceptance/bundle/help/bundle-init/output.txt @@ -6,7 +6,7 @@ TEMPLATE_PATH optionally specifies which template to use. It can be one of the f - default-python: The default Python template for Notebooks and Lakeflow - default-sql: The default SQL template for .sql files that run with Databricks SQL - default-minimal: The minimal template, for advanced users -- skeleton: A bare bundle with just a databricks.yml and an empty resources directory +- empty: A bare bundle with just a databricks.yml and an empty resources directory - default-scala: The default Scala template for JAR jobs - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks) - mlops-stacks: The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks) diff --git a/acceptance/bundle/templates/empty/input.json b/acceptance/bundle/templates/empty/input.json new file mode 100644 index 00000000000..adf5147b079 --- /dev/null +++ b/acceptance/bundle/templates/empty/input.json @@ -0,0 +1,3 @@ +{ + "project_name": "my_empty" +} diff --git a/acceptance/bundle/templates/skeleton/out.test.toml b/acceptance/bundle/templates/empty/out.test.toml similarity index 100% rename from acceptance/bundle/templates/skeleton/out.test.toml rename to acceptance/bundle/templates/empty/out.test.toml diff --git a/acceptance/bundle/templates/skeleton/output.txt b/acceptance/bundle/templates/empty/output.txt similarity index 55% rename from acceptance/bundle/templates/skeleton/output.txt rename to acceptance/bundle/templates/empty/output.txt index 6d89a27bc13..997e3f829f3 100644 --- a/acceptance/bundle/templates/skeleton/output.txt +++ b/acceptance/bundle/templates/empty/output.txt @@ -1,7 +1,7 @@ ->>> [CLI] bundle init skeleton --config-file ./input.json --output-dir output +>>> [CLI] bundle init empty --config-file ./input.json --output-dir output -Welcome to the skeleton template for Declarative Automation Bundles! +Welcome to the empty template for Declarative Automation Bundles! This template creates a bare-bones bundle with just a databricks.yml and an empty resources/ directory, ready for you to add your own jobs, pipelines, and other resources. @@ -10,17 +10,17 @@ A workspace was selected based on your current profile. For information about ho change this, see https://docs.databricks.com/dev-tools/cli/profiles.html. workspace_host: [DATABRICKS_URL] -✨ Your new project has been created in the 'my_skeleton' directory! +✨ Your new project has been created in the 'my_empty' directory! -Add resource definitions under my_skeleton/resources/, then deploy with: - cd my_skeleton +Add resource definitions under my_empty/resources/, then deploy with: + cd my_empty databricks bundle deploy >>> [CLI] bundle validate -t dev -Name: my_skeleton +Name: my_empty Target: dev Workspace: User: [USERNAME] - Path: /Workspace/Users/[USERNAME]/.bundle/my_skeleton/dev + Path: /Workspace/Users/[USERNAME]/.bundle/my_empty/dev Validation OK! diff --git a/acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml b/acceptance/bundle/templates/empty/output/my_empty/databricks.yml similarity index 85% rename from acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml rename to acceptance/bundle/templates/empty/output/my_empty/databricks.yml index 33d2c8c3414..57d4637fbde 100644 --- a/acceptance/bundle/templates/skeleton/output/my_skeleton/databricks.yml +++ b/acceptance/bundle/templates/empty/output/my_empty/databricks.yml @@ -1,7 +1,7 @@ -# This is a Databricks asset bundle definition for my_skeleton. +# This is a Databricks asset bundle definition for my_empty. # See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. bundle: - name: my_skeleton + name: my_empty include: - resources/*.yml diff --git a/acceptance/bundle/templates/skeleton/output/my_skeleton/resources/.gitkeep b/acceptance/bundle/templates/empty/output/my_empty/resources/.gitkeep similarity index 100% rename from acceptance/bundle/templates/skeleton/output/my_skeleton/resources/.gitkeep rename to acceptance/bundle/templates/empty/output/my_empty/resources/.gitkeep diff --git a/acceptance/bundle/templates/skeleton/script b/acceptance/bundle/templates/empty/script similarity index 60% rename from acceptance/bundle/templates/skeleton/script rename to acceptance/bundle/templates/empty/script index 031348292aa..7fd72eda55a 100644 --- a/acceptance/bundle/templates/skeleton/script +++ b/acceptance/bundle/templates/empty/script @@ -1,6 +1,6 @@ -trace $CLI bundle init skeleton --config-file ./input.json --output-dir output +trace $CLI bundle init empty --config-file ./input.json --output-dir output -cd output/my_skeleton +cd output/my_empty # Verify that the empty resources directory is preserved [ -d "resources" ] || exit 1 diff --git a/acceptance/bundle/templates/skeleton/input.json b/acceptance/bundle/templates/skeleton/input.json deleted file mode 100644 index 6734f26069d..00000000000 --- a/acceptance/bundle/templates/skeleton/input.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "project_name": "my_skeleton" -} diff --git a/libs/template/template.go b/libs/template/template.go index 736f1bb7c0b..edd3456691a 100644 --- a/libs/template/template.go +++ b/libs/template/template.go @@ -26,7 +26,7 @@ type TemplateName string const ( DefaultPython TemplateName = "default-python" DefaultMinimal TemplateName = "default-minimal" - Skeleton TemplateName = "skeleton" + Empty TemplateName = "empty" DefaultScala TemplateName = "default-scala" ExperimentalDefaultPython TemplateName = "experimental-default-python-vnext" DefaultSql TemplateName = "default-sql" @@ -61,10 +61,10 @@ var databricksTemplates = []Template{ Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: DefaultMinimal}}, }, { - name: Skeleton, + name: Empty, description: "A bare bundle with just a databricks.yml and an empty resources directory", - Reader: &builtinReader{name: string(Skeleton)}, - Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: Skeleton}}, + Reader: &builtinReader{name: string(Empty)}, + Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: Empty}}, }, { name: DefaultScala, diff --git a/libs/template/template_test.go b/libs/template/template_test.go index c3319703bbc..6d2fc8d563f 100644 --- a/libs/template/template_test.go +++ b/libs/template/template_test.go @@ -11,7 +11,7 @@ func TestTemplateHelpDescriptions(t *testing.T) { expected := `- default-python: The default Python template for Notebooks and Lakeflow - default-sql: The default SQL template for .sql files that run with Databricks SQL - default-minimal: The minimal template, for advanced users -- skeleton: A bare bundle with just a databricks.yml and an empty resources directory +- empty: A bare bundle with just a databricks.yml and an empty resources directory - default-scala: The default Scala template for JAR jobs - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks) - mlops-stacks: The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks) @@ -24,7 +24,7 @@ func TestTemplateOptions(t *testing.T) { {Name: "default-python", Id: "The default Python template for Notebooks and Lakeflow"}, {Name: "default-sql", Id: "The default SQL template for .sql files that run with Databricks SQL"}, {Name: "default-minimal", Id: "The minimal template, for advanced users"}, - {Name: "skeleton", Id: "A bare bundle with just a databricks.yml and an empty resources directory"}, + {Name: "empty", Id: "A bare bundle with just a databricks.yml and an empty resources directory"}, {Name: "default-scala", Id: "The default Scala template for JAR jobs"}, {Name: "dbt-sql", Id: "The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks)"}, {Name: "mlops-stacks", Id: "The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks)"}, @@ -60,7 +60,7 @@ func TestTemplateGetDatabricksTemplate(t *testing.T) { names := []TemplateName{ DefaultPython, DefaultMinimal, - Skeleton, + Empty, DefaultScala, DefaultSql, DbtSql, diff --git a/libs/template/templates/skeleton/databricks_template_schema.json b/libs/template/templates/empty/databricks_template_schema.json similarity index 56% rename from libs/template/templates/skeleton/databricks_template_schema.json rename to libs/template/templates/empty/databricks_template_schema.json index 6d0a73e6f5c..f7d4de28d35 100644 --- a/libs/template/templates/skeleton/databricks_template_schema.json +++ b/libs/template/templates/empty/databricks_template_schema.json @@ -1,5 +1,5 @@ { - "welcome_message": "\nWelcome to the skeleton template for Declarative Automation Bundles!\n\nThis template creates a bare-bones bundle with just a databricks.yml and an empty\nresources/ directory, ready for you to add your own jobs, pipelines, and other resources.\n\nA workspace was selected based on your current profile. For information about how to\nchange this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}", + "welcome_message": "\nWelcome to the empty template for Declarative Automation Bundles!\n\nThis template creates a bare-bones bundle with just a databricks.yml and an empty\nresources/ directory, ready for you to add your own jobs, pipelines, and other resources.\n\nA workspace was selected based on your current profile. For information about how to\nchange this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}", "properties": { "project_name": { "type": "string", diff --git a/libs/template/templates/skeleton/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl similarity index 100% rename from libs/template/templates/skeleton/template/{{.project_name}}/databricks.yml.tmpl rename to libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl diff --git a/libs/template/templates/skeleton/template/{{.project_name}}/resources/.gitkeep b/libs/template/templates/empty/template/{{.project_name}}/resources/.gitkeep similarity index 100% rename from libs/template/templates/skeleton/template/{{.project_name}}/resources/.gitkeep rename to libs/template/templates/empty/template/{{.project_name}}/resources/.gitkeep From 6ba12be8ab9a8dbf95209e106cbbf29d9b4749ea Mon Sep 17 00:00:00 2001 From: Jan N Rose Date: Wed, 15 Jul 2026 14:14:45 +0200 Subject: [PATCH 05/17] add PR link to changelog --- .nextchanges/bundles/empty-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nextchanges/bundles/empty-template.md b/.nextchanges/bundles/empty-template.md index 96a01a08b2f..4b960b751a4 100644 --- a/.nextchanges/bundles/empty-template.md +++ b/.nextchanges/bundles/empty-template.md @@ -1 +1 @@ -Added an `empty` bundle template that scaffolds a bare `databricks.yml` and an empty `resources/` directory. Use it with `databricks bundle init empty` to start a new bundle without any sample code. +Added an `empty` bundle template that scaffolds a bare `databricks.yml` and an empty `resources/` directory. Use it with `databricks bundle init empty` to start a new bundle without any sample code ([#5899](https://github.com/databricks/cli/pull/5899)). From 1c9cb9c8d618c8f33fee463ae1f8709855273076 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Jul 2026 15:05:17 +0200 Subject: [PATCH 06/17] Address review: add .gitignore to template and unwrap welcome message Co-authored-by: Isaac --- acceptance/bundle/templates/empty/output.txt | 6 ++---- .../bundle/templates/empty/output/my_empty/.gitignore | 1 + .../templates/empty/databricks_template_schema.json | 2 +- .../templates/empty/template/{{.project_name}}/.gitignore | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 acceptance/bundle/templates/empty/output/my_empty/.gitignore create mode 100644 libs/template/templates/empty/template/{{.project_name}}/.gitignore diff --git a/acceptance/bundle/templates/empty/output.txt b/acceptance/bundle/templates/empty/output.txt index 997e3f829f3..8f8f79474a3 100644 --- a/acceptance/bundle/templates/empty/output.txt +++ b/acceptance/bundle/templates/empty/output.txt @@ -3,11 +3,9 @@ Welcome to the empty template for Declarative Automation Bundles! -This template creates a bare-bones bundle with just a databricks.yml and an empty -resources/ directory, ready for you to add your own jobs, pipelines, and other resources. +This template creates a bare-bones bundle with just a databricks.yml and an empty resources/ directory, ready for you to add your own jobs, pipelines, and other resources. -A workspace was selected based on your current profile. For information about how to -change this, see https://docs.databricks.com/dev-tools/cli/profiles.html. +A workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html. workspace_host: [DATABRICKS_URL] ✨ Your new project has been created in the 'my_empty' directory! diff --git a/acceptance/bundle/templates/empty/output/my_empty/.gitignore b/acceptance/bundle/templates/empty/output/my_empty/.gitignore new file mode 100644 index 00000000000..590f86d986c --- /dev/null +++ b/acceptance/bundle/templates/empty/output/my_empty/.gitignore @@ -0,0 +1 @@ +.databricks/ diff --git a/libs/template/templates/empty/databricks_template_schema.json b/libs/template/templates/empty/databricks_template_schema.json index f7d4de28d35..c404d2128b2 100644 --- a/libs/template/templates/empty/databricks_template_schema.json +++ b/libs/template/templates/empty/databricks_template_schema.json @@ -1,5 +1,5 @@ { - "welcome_message": "\nWelcome to the empty template for Declarative Automation Bundles!\n\nThis template creates a bare-bones bundle with just a databricks.yml and an empty\nresources/ directory, ready for you to add your own jobs, pipelines, and other resources.\n\nA workspace was selected based on your current profile. For information about how to\nchange this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}", + "welcome_message": "\nWelcome to the empty template for Declarative Automation Bundles!\n\nThis template creates a bare-bones bundle with just a databricks.yml and an empty resources/ directory, ready for you to add your own jobs, pipelines, and other resources.\n\nA workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}", "properties": { "project_name": { "type": "string", diff --git a/libs/template/templates/empty/template/{{.project_name}}/.gitignore b/libs/template/templates/empty/template/{{.project_name}}/.gitignore new file mode 100644 index 00000000000..590f86d986c --- /dev/null +++ b/libs/template/templates/empty/template/{{.project_name}}/.gitignore @@ -0,0 +1 @@ +.databricks/ From 00216dde670a08a873f7ff7a2deaddb8d82d8d0e Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Jul 2026 15:10:00 +0200 Subject: [PATCH 07/17] DAB rename --- .../empty/template/{{.project_name}}/databricks.yml.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl index b9e16dfda85..2bdaf950cdf 100644 --- a/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl +++ b/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl @@ -1,4 +1,4 @@ -# This is a Databricks asset bundle definition for {{.project_name}}. +# This is a Declarative Automation Bundle definition for {{.project_name}}. # See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. bundle: name: {{.project_name}} From 684935efeb0c4c544b806a5b695988b328cf7d49 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Jul 2026 15:18:10 +0200 Subject: [PATCH 08/17] Set workspace host in dev target for consistency with other templates Co-authored-by: Isaac --- acceptance/bundle/templates/empty/output.txt | 1 + .../bundle/templates/empty/output/my_empty/databricks.yml | 4 +++- .../empty/template/{{.project_name}}/databricks.yml.tmpl | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/acceptance/bundle/templates/empty/output.txt b/acceptance/bundle/templates/empty/output.txt index 8f8f79474a3..5f34d97de14 100644 --- a/acceptance/bundle/templates/empty/output.txt +++ b/acceptance/bundle/templates/empty/output.txt @@ -18,6 +18,7 @@ Add resource definitions under my_empty/resources/, then deploy with: Name: my_empty Target: dev Workspace: + Host: [DATABRICKS_URL] User: [USERNAME] Path: /Workspace/Users/[USERNAME]/.bundle/my_empty/dev diff --git a/acceptance/bundle/templates/empty/output/my_empty/databricks.yml b/acceptance/bundle/templates/empty/output/my_empty/databricks.yml index 57d4637fbde..f63a3690efc 100644 --- a/acceptance/bundle/templates/empty/output/my_empty/databricks.yml +++ b/acceptance/bundle/templates/empty/output/my_empty/databricks.yml @@ -1,4 +1,4 @@ -# This is a Databricks asset bundle definition for my_empty. +# This is a Declarative Automation Bundle definition for my_empty. # See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. bundle: name: my_empty @@ -14,3 +14,5 @@ targets: dev: mode: development default: true + workspace: + host: [DATABRICKS_URL] diff --git a/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl index 2bdaf950cdf..ec87bbe5e30 100644 --- a/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl +++ b/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl @@ -14,3 +14,5 @@ targets: dev: mode: development default: true + workspace: + host: {{workspace_host}} From ded42305fe46de16c1c15918dba8afce228c7b0e Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 10:21:05 +0200 Subject: [PATCH 09/17] Make empty an alias of a simplified default-minimal Per the DABs core eng weekly (2026-07-16), consolidate the empty template into default-minimal instead of shipping a separate template: - Remove the standalone empty template; add 'empty' as an alias of default-minimal so 'databricks bundle init empty' still works. - Simplify default-minimal: stop prompting for a personal schema (always use a personal dev schema) and reduce the language question to python/skip, since sql and other produced identical output. - Add a comment in the shared databricks.yml template guiding users on the catalog and schema variables. Co-authored-by: Isaac --- .nextchanges/bundles/empty-alias-minimal.md | 1 + .nextchanges/bundles/empty-template.md | 1 - acceptance/bundle/help/bundle-init/output.txt | 1 - .../templates/default-minimal/input.json | 2 +- .../output/my_default_minimal/databricks.yml | 2 ++ .../classic/out.compare-vs-serverless.diff | 2 +- .../output/my_default_python/databricks.yml | 2 ++ .../serverless-customcatalog/output.txt | 4 +-- .../output/my_default_python/databricks.yml | 2 ++ acceptance/bundle/templates/empty/input.json | 3 --- .../bundle/templates/empty/out.test.toml | 3 --- acceptance/bundle/templates/empty/output.txt | 25 ------------------- .../empty/output/my_empty/.gitignore | 1 - .../empty/output/my_empty/databricks.yml | 18 ------------- .../empty/output/my_empty/resources/.gitkeep | 2 -- acceptance/bundle/templates/empty/script | 12 --------- .../my_lakeflow_pipelines/databricks.yml | 2 ++ .../my_lakeflow_pipelines/databricks.yml | 2 ++ .../output/my_pydabs/databricks.yml | 2 ++ .../default-python/out.databricks.yml | 2 ++ libs/template/template.go | 8 +----- libs/template/template_test.go | 4 +-- .../databricks_template_schema.json | 7 +++--- .../{{.project_name}}/databricks.yml.tmpl | 2 ++ .../empty/databricks_template_schema.json | 14 ----------- .../template/{{.project_name}}/.gitignore | 1 - .../{{.project_name}}/databricks.yml.tmpl | 18 ------------- .../{{.project_name}}/resources/.gitkeep | 2 -- 28 files changed, 27 insertions(+), 118 deletions(-) create mode 100644 .nextchanges/bundles/empty-alias-minimal.md delete mode 100644 .nextchanges/bundles/empty-template.md delete mode 100644 acceptance/bundle/templates/empty/input.json delete mode 100644 acceptance/bundle/templates/empty/out.test.toml delete mode 100644 acceptance/bundle/templates/empty/output.txt delete mode 100644 acceptance/bundle/templates/empty/output/my_empty/.gitignore delete mode 100644 acceptance/bundle/templates/empty/output/my_empty/databricks.yml delete mode 100644 acceptance/bundle/templates/empty/output/my_empty/resources/.gitkeep delete mode 100644 acceptance/bundle/templates/empty/script delete mode 100644 libs/template/templates/empty/databricks_template_schema.json delete mode 100644 libs/template/templates/empty/template/{{.project_name}}/.gitignore delete mode 100644 libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl delete mode 100644 libs/template/templates/empty/template/{{.project_name}}/resources/.gitkeep diff --git a/.nextchanges/bundles/empty-alias-minimal.md b/.nextchanges/bundles/empty-alias-minimal.md new file mode 100644 index 00000000000..b35448f88b2 --- /dev/null +++ b/.nextchanges/bundles/empty-alias-minimal.md @@ -0,0 +1 @@ +Simplified the `default-minimal` bundle template: it no longer prompts for a personal schema, and the initial language question is now `python` or `skip`. You can also reach it with the friendlier alias `databricks bundle init empty` ([#5899](https://github.com/databricks/cli/pull/5899)). diff --git a/.nextchanges/bundles/empty-template.md b/.nextchanges/bundles/empty-template.md deleted file mode 100644 index 4b960b751a4..00000000000 --- a/.nextchanges/bundles/empty-template.md +++ /dev/null @@ -1 +0,0 @@ -Added an `empty` bundle template that scaffolds a bare `databricks.yml` and an empty `resources/` directory. Use it with `databricks bundle init empty` to start a new bundle without any sample code ([#5899](https://github.com/databricks/cli/pull/5899)). diff --git a/acceptance/bundle/help/bundle-init/output.txt b/acceptance/bundle/help/bundle-init/output.txt index 5c6a03ccd3a..dad5e198e4c 100644 --- a/acceptance/bundle/help/bundle-init/output.txt +++ b/acceptance/bundle/help/bundle-init/output.txt @@ -6,7 +6,6 @@ TEMPLATE_PATH optionally specifies which template to use. It can be one of the f - default-python: The default Python template for Notebooks and Lakeflow - default-sql: The default SQL template for .sql files that run with Databricks SQL - default-minimal: The minimal template, for advanced users -- empty: A bare bundle with just a databricks.yml and an empty resources directory - default-scala: The default Scala template for JAR jobs - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks) - mlops-stacks: The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks) diff --git a/acceptance/bundle/templates/default-minimal/input.json b/acceptance/bundle/templates/default-minimal/input.json index 8a354d617c9..b66e679822d 100644 --- a/acceptance/bundle/templates/default-minimal/input.json +++ b/acceptance/bundle/templates/default-minimal/input.json @@ -1,4 +1,4 @@ { "project_name": "my_default_minimal", - "language_choice": "sql" + "language_choice": "skip" } diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml index c10c7416920..4ab1d025585 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml @@ -8,6 +8,8 @@ include: - resources/*.yml # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff b/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff index 35c0d8bea6e..7125ac8f02d 100644 --- a/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff +++ b/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff @@ -1,6 +1,6 @@ --- [TESTROOT]/bundle/templates/default-python/classic/../serverless/output/my_default_python/databricks.yml +++ output/my_default_python/databricks.yml -@@ -33,4 +33,6 @@ +@@ -35,4 +35,6 @@ catalog: hive_metastore schema: ${workspace.current_user.short_name} + presets: diff --git a/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml b/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml index fe79065310e..d463f40bacd 100644 --- a/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml +++ b/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml @@ -13,6 +13,8 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt b/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt index 5142d961643..aa8a5b06076 100644 --- a/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt +++ b/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt @@ -15,14 +15,14 @@ To get started, refer to the project README.md file and the documentation at htt >>> diff.py [TESTROOT]/bundle/templates/default-python/serverless-customcatalog/../serverless/output output/ --- [TESTROOT]/bundle/templates/default-python/serverless-customcatalog/../serverless/output/my_default_python/databricks.yml +++ output/my_default_python/databricks.yml -@@ -31,5 +31,5 @@ +@@ -33,5 +33,5 @@ host: [DATABRICKS_URL] variables: - catalog: hive_metastore + catalog: customcatalog schema: ${workspace.current_user.short_name} prod: -@@ -40,5 +40,5 @@ +@@ -42,5 +42,5 @@ root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target} variables: - catalog: hive_metastore diff --git a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml index 2683348b94f..f262dcbbbd9 100644 --- a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml +++ b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml @@ -13,6 +13,8 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/empty/input.json b/acceptance/bundle/templates/empty/input.json deleted file mode 100644 index adf5147b079..00000000000 --- a/acceptance/bundle/templates/empty/input.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "project_name": "my_empty" -} diff --git a/acceptance/bundle/templates/empty/out.test.toml b/acceptance/bundle/templates/empty/out.test.toml deleted file mode 100644 index f784a183258..00000000000 --- a/acceptance/bundle/templates/empty/out.test.toml +++ /dev/null @@ -1,3 +0,0 @@ -Local = true -Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/bundle/templates/empty/output.txt b/acceptance/bundle/templates/empty/output.txt deleted file mode 100644 index 5f34d97de14..00000000000 --- a/acceptance/bundle/templates/empty/output.txt +++ /dev/null @@ -1,25 +0,0 @@ - ->>> [CLI] bundle init empty --config-file ./input.json --output-dir output - -Welcome to the empty template for Declarative Automation Bundles! - -This template creates a bare-bones bundle with just a databricks.yml and an empty resources/ directory, ready for you to add your own jobs, pipelines, and other resources. - -A workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html. -workspace_host: [DATABRICKS_URL] - -✨ Your new project has been created in the 'my_empty' directory! - -Add resource definitions under my_empty/resources/, then deploy with: - cd my_empty - databricks bundle deploy - ->>> [CLI] bundle validate -t dev -Name: my_empty -Target: dev -Workspace: - Host: [DATABRICKS_URL] - User: [USERNAME] - Path: /Workspace/Users/[USERNAME]/.bundle/my_empty/dev - -Validation OK! diff --git a/acceptance/bundle/templates/empty/output/my_empty/.gitignore b/acceptance/bundle/templates/empty/output/my_empty/.gitignore deleted file mode 100644 index 590f86d986c..00000000000 --- a/acceptance/bundle/templates/empty/output/my_empty/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.databricks/ diff --git a/acceptance/bundle/templates/empty/output/my_empty/databricks.yml b/acceptance/bundle/templates/empty/output/my_empty/databricks.yml deleted file mode 100644 index f63a3690efc..00000000000 --- a/acceptance/bundle/templates/empty/output/my_empty/databricks.yml +++ /dev/null @@ -1,18 +0,0 @@ -# This is a Declarative Automation Bundle definition for my_empty. -# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. -bundle: - name: my_empty - -include: - - resources/*.yml - -targets: - # The 'dev' target is the default target. It uses 'mode: development' to create - # development copies: deployed resources get prefixed with '[dev my_user_name]' - # and any schedules and triggers are paused by default. - # See https://docs.databricks.com/dev-tools/bundles/deployment-modes.html. - dev: - mode: development - default: true - workspace: - host: [DATABRICKS_URL] diff --git a/acceptance/bundle/templates/empty/output/my_empty/resources/.gitkeep b/acceptance/bundle/templates/empty/output/my_empty/resources/.gitkeep deleted file mode 100644 index 5b0d6b6f74b..00000000000 --- a/acceptance/bundle/templates/empty/output/my_empty/resources/.gitkeep +++ /dev/null @@ -1,2 +0,0 @@ - -This folder is reserved for Declarative Automation Bundles resource definitions. diff --git a/acceptance/bundle/templates/empty/script b/acceptance/bundle/templates/empty/script deleted file mode 100644 index 7fd72eda55a..00000000000 --- a/acceptance/bundle/templates/empty/script +++ /dev/null @@ -1,12 +0,0 @@ -trace $CLI bundle init empty --config-file ./input.json --output-dir output - -cd output/my_empty - -# Verify that the empty resources directory is preserved -[ -d "resources" ] || exit 1 - -trace $CLI bundle validate -t dev - -rm -r .databricks - -cd ../../ diff --git a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml index 9df14beed6c..f3dbfa66586 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml +++ b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml @@ -8,6 +8,8 @@ include: - resources/*.yml # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml index 9df14beed6c..f3dbfa66586 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml +++ b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml @@ -8,6 +8,8 @@ include: - resources/*.yml # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml b/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml index 8bb7b985107..a58423980bf 100644 --- a/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml +++ b/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml @@ -19,6 +19,8 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml b/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml index 2e00b00b9e4..19599a16f8a 100644 --- a/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml +++ b/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml @@ -13,6 +13,8 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/libs/template/template.go b/libs/template/template.go index edd3456691a..cb2e1a8e3a2 100644 --- a/libs/template/template.go +++ b/libs/template/template.go @@ -26,7 +26,6 @@ type TemplateName string const ( DefaultPython TemplateName = "default-python" DefaultMinimal TemplateName = "default-minimal" - Empty TemplateName = "empty" DefaultScala TemplateName = "default-scala" ExperimentalDefaultPython TemplateName = "experimental-default-python-vnext" DefaultSql TemplateName = "default-sql" @@ -57,15 +56,10 @@ var databricksTemplates = []Template{ { name: DefaultMinimal, description: "The minimal template, for advanced users", + aliases: []string{"empty"}, Reader: &builtinReader{name: string(DefaultMinimal)}, Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: DefaultMinimal}}, }, - { - name: Empty, - description: "A bare bundle with just a databricks.yml and an empty resources directory", - Reader: &builtinReader{name: string(Empty)}, - Writer: &writerWithFullTelemetry{defaultWriter: defaultWriter{name: Empty}}, - }, { name: DefaultScala, description: "The default Scala template for JAR jobs", diff --git a/libs/template/template_test.go b/libs/template/template_test.go index 6d2fc8d563f..b0a5b6c641b 100644 --- a/libs/template/template_test.go +++ b/libs/template/template_test.go @@ -11,7 +11,6 @@ func TestTemplateHelpDescriptions(t *testing.T) { expected := `- default-python: The default Python template for Notebooks and Lakeflow - default-sql: The default SQL template for .sql files that run with Databricks SQL - default-minimal: The minimal template, for advanced users -- empty: A bare bundle with just a databricks.yml and an empty resources directory - default-scala: The default Scala template for JAR jobs - dbt-sql: The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks) - mlops-stacks: The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks) @@ -24,7 +23,6 @@ func TestTemplateOptions(t *testing.T) { {Name: "default-python", Id: "The default Python template for Notebooks and Lakeflow"}, {Name: "default-sql", Id: "The default SQL template for .sql files that run with Databricks SQL"}, {Name: "default-minimal", Id: "The minimal template, for advanced users"}, - {Name: "empty", Id: "A bare bundle with just a databricks.yml and an empty resources directory"}, {Name: "default-scala", Id: "The default Scala template for JAR jobs"}, {Name: "dbt-sql", Id: "The dbt SQL template (databricks.com/blog/delivering-cost-effective-data-real-time-dbt-and-databricks)"}, {Name: "mlops-stacks", Id: "The Databricks MLOps Stacks template (github.com/databricks/mlops-stacks)"}, @@ -60,7 +58,6 @@ func TestTemplateGetDatabricksTemplate(t *testing.T) { names := []TemplateName{ DefaultPython, DefaultMinimal, - Empty, DefaultScala, DefaultSql, DbtSql, @@ -87,4 +84,5 @@ func TestTemplateGetDatabricksTemplate(t *testing.T) { // Assert aliases work. assert.Equal(t, MlopsStacks, GetDatabricksTemplate(TemplateName("mlops-stack")).name) + assert.Equal(t, DefaultMinimal, GetDatabricksTemplate(TemplateName("empty")).name) } diff --git a/libs/template/templates/default-minimal/databricks_template_schema.json b/libs/template/templates/default-minimal/databricks_template_schema.json index c6f5badc23a..719dda75e88 100644 --- a/libs/template/templates/default-minimal/databricks_template_schema.json +++ b/libs/template/templates/default-minimal/databricks_template_schema.json @@ -63,13 +63,15 @@ "order": 6 }, "personal_schemas": { + "//": "Always 'yes' for default-minimal: development uses a personal schema based on the current user name", + "skip_prompt_if": {}, "type": "string", - "description": "Use a personal schema for each user working on this project\n(this is recommended, your personal schema will be '{{.default_catalog}}.{{short_name}}')", "default": "yes", "enum": [ "yes", "no, I will customize the schema configuration later in databricks.yml" ], + "description": "Use a personal schema for each user working on this project", "order": 7 }, "language_choice": { @@ -78,8 +80,7 @@ "description": "Initial language for this project", "enum": [ "python", - "sql", - "other" + "skip" ], "order": 8 }, diff --git a/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl index 5849ae7a39a..da795d028c3 100644 --- a/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl @@ -27,6 +27,8 @@ artifacts: {{- end}} # Variable declarations. These variables are assigned in the dev/prod targets below. +# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog +# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/libs/template/templates/empty/databricks_template_schema.json b/libs/template/templates/empty/databricks_template_schema.json deleted file mode 100644 index c404d2128b2..00000000000 --- a/libs/template/templates/empty/databricks_template_schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "welcome_message": "\nWelcome to the empty template for Declarative Automation Bundles!\n\nThis template creates a bare-bones bundle with just a databricks.yml and an empty resources/ directory, ready for you to add your own jobs, pipelines, and other resources.\n\nA workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}", - "properties": { - "project_name": { - "type": "string", - "default": "my_bundle", - "description": "\nUnique name for this project.\nproject_name", - "order": 1, - "pattern": "^[A-Za-z0-9_]+$", - "pattern_match_failure_message": "Name must consist of letters, numbers, and underscores." - } - }, - "success_message": "\n✨ Your new project has been created in the '{{.project_name}}' directory!\n\nAdd resource definitions under {{.project_name}}/resources/, then deploy with:\n cd {{.project_name}}\n databricks bundle deploy" -} diff --git a/libs/template/templates/empty/template/{{.project_name}}/.gitignore b/libs/template/templates/empty/template/{{.project_name}}/.gitignore deleted file mode 100644 index 590f86d986c..00000000000 --- a/libs/template/templates/empty/template/{{.project_name}}/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.databricks/ diff --git a/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl deleted file mode 100644 index ec87bbe5e30..00000000000 --- a/libs/template/templates/empty/template/{{.project_name}}/databricks.yml.tmpl +++ /dev/null @@ -1,18 +0,0 @@ -# This is a Declarative Automation Bundle definition for {{.project_name}}. -# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. -bundle: - name: {{.project_name}} - -include: - - resources/*.yml - -targets: - # The 'dev' target is the default target. It uses 'mode: development' to create - # development copies: deployed resources get prefixed with '[dev my_user_name]' - # and any schedules and triggers are paused by default. - # See https://docs.databricks.com/dev-tools/bundles/deployment-modes.html. - dev: - mode: development - default: true - workspace: - host: {{workspace_host}} diff --git a/libs/template/templates/empty/template/{{.project_name}}/resources/.gitkeep b/libs/template/templates/empty/template/{{.project_name}}/resources/.gitkeep deleted file mode 100644 index 5b0d6b6f74b..00000000000 --- a/libs/template/templates/empty/template/{{.project_name}}/resources/.gitkeep +++ /dev/null @@ -1,2 +0,0 @@ - -This folder is reserved for Declarative Automation Bundles resource definitions. From 9a4e7de7de8a97d16fa23e3e0d1b5a9c70e89226 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 10:25:21 +0200 Subject: [PATCH 10/17] Revert "Make bundle command error more actionable if run without databricks.yml" This reverts commit aa5cdb2d8e7e925af32939997f690cfb6026fd61. --- acceptance/bundle/run/inline-script/no-bundle/output.txt | 2 +- acceptance/bundle/run/inline-script/no-separator/output.txt | 2 +- bundle/root.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/run/inline-script/no-bundle/output.txt b/acceptance/bundle/run/inline-script/no-bundle/output.txt index 4c41b8e366d..870f682634f 100644 --- a/acceptance/bundle/run/inline-script/no-bundle/output.txt +++ b/acceptance/bundle/run/inline-script/no-bundle/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle run -- echo hello -Error: unable to locate bundle root: databricks.yml not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one +Error: unable to locate bundle root: databricks.yml not found Exit code: 1 diff --git a/acceptance/bundle/run/inline-script/no-separator/output.txt b/acceptance/bundle/run/inline-script/no-separator/output.txt index 937988ce833..7a35cab72e4 100644 --- a/acceptance/bundle/run/inline-script/no-separator/output.txt +++ b/acceptance/bundle/run/inline-script/no-separator/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle run echo hello -Error: unable to locate bundle root: databricks.yml not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one +Error: unable to locate bundle root: databricks.yml not found Exit code: 1 diff --git a/bundle/root.go b/bundle/root.go index 9f6f2c5f6bb..9ea9a8c13fe 100644 --- a/bundle/root.go +++ b/bundle/root.go @@ -45,7 +45,7 @@ func getRootWithTraversal() (string, error) { } } - return "", fmt.Errorf(`unable to locate bundle root: %s not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one`, config.FileNames[0]) + return "", fmt.Errorf(`unable to locate bundle root: %s not found`, config.FileNames[0]) } // mustGetRoot returns a bundle root or an error if one cannot be found. From dbc254a425bfad1c7758ba11f1069128c21075bc Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:05:04 +0200 Subject: [PATCH 11/17] Keep sql as a language option and blank the README language for skip - Restore 'sql' alongside 'python' and 'skip' in default-minimal's language picker; derive .language directly from the choice instead of collapsing non-python to sql. - Gate the Python extras (pyproject.toml, tests/) on 'not python' rather than 'is sql' so 'skip' excludes them too; unchanged for default-python. - README: render 'SQL' for sql, 'Python' for python, and nothing for skip. - Drop the extra catalog/schema comment from the shared databricks.yml; the existing comment was sufficient. Co-authored-by: Isaac --- .nextchanges/bundles/empty-alias-minimal.md | 2 +- .../default-minimal/output/my_default_minimal/README.md | 2 +- .../default-minimal/output/my_default_minimal/databricks.yml | 2 -- .../default-python/classic/out.compare-vs-serverless.diff | 2 +- .../classic/output/my_default_python/databricks.yml | 2 -- .../default-python/serverless-customcatalog/output.txt | 4 ++-- .../serverless/output/my_default_python/databricks.yml | 2 -- .../python/output/my_lakeflow_pipelines/databricks.yml | 2 -- .../sql/output/my_lakeflow_pipelines/databricks.yml | 2 -- .../pydabs/init-classic/output/my_pydabs/databricks.yml | 2 -- .../templates/telemetry/default-python/out.databricks.yml | 2 -- .../default-minimal/databricks_template_schema.json | 5 +++-- libs/template/templates/default/template/__preamble.tmpl | 5 +++-- .../default/template/{{.project_name}}/README.md.tmpl | 4 ++-- .../default/template/{{.project_name}}/databricks.yml.tmpl | 2 -- 15 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.nextchanges/bundles/empty-alias-minimal.md b/.nextchanges/bundles/empty-alias-minimal.md index b35448f88b2..4a1179f3f82 100644 --- a/.nextchanges/bundles/empty-alias-minimal.md +++ b/.nextchanges/bundles/empty-alias-minimal.md @@ -1 +1 @@ -Simplified the `default-minimal` bundle template: it no longer prompts for a personal schema, and the initial language question is now `python` or `skip`. You can also reach it with the friendlier alias `databricks bundle init empty` ([#5899](https://github.com/databricks/cli/pull/5899)). +Simplified the `default-minimal` bundle template: it no longer prompts for a personal schema, and the initial language question now offers a `skip` option for a bare bundle. You can also reach it with the friendlier alias `databricks bundle init empty` ([#5899](https://github.com/databricks/cli/pull/5899)). diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md index 4304687ae33..275cdeb1323 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md @@ -2,7 +2,7 @@ The 'my_default_minimal' project was generated by using the default-minimal template. -* `src/`: SQL source code for this project. +* `src/`: source code for this project. * `resources/`: Resource configurations (jobs, pipelines, etc.) ## Getting started diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml index 9a7d4e8609c..ec72bde8b31 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml @@ -8,8 +8,6 @@ include: - resources/*.yml # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff b/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff index 7125ac8f02d..35c0d8bea6e 100644 --- a/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff +++ b/acceptance/bundle/templates/default-python/classic/out.compare-vs-serverless.diff @@ -1,6 +1,6 @@ --- [TESTROOT]/bundle/templates/default-python/classic/../serverless/output/my_default_python/databricks.yml +++ output/my_default_python/databricks.yml -@@ -35,4 +35,6 @@ +@@ -33,4 +33,6 @@ catalog: hive_metastore schema: ${workspace.current_user.short_name} + presets: diff --git a/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml b/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml index 149d31593eb..d5abd8c8fa4 100644 --- a/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml +++ b/acceptance/bundle/templates/default-python/classic/output/my_default_python/databricks.yml @@ -13,8 +13,6 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt b/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt index aa8a5b06076..5142d961643 100644 --- a/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt +++ b/acceptance/bundle/templates/default-python/serverless-customcatalog/output.txt @@ -15,14 +15,14 @@ To get started, refer to the project README.md file and the documentation at htt >>> diff.py [TESTROOT]/bundle/templates/default-python/serverless-customcatalog/../serverless/output output/ --- [TESTROOT]/bundle/templates/default-python/serverless-customcatalog/../serverless/output/my_default_python/databricks.yml +++ output/my_default_python/databricks.yml -@@ -33,5 +33,5 @@ +@@ -31,5 +31,5 @@ host: [DATABRICKS_URL] variables: - catalog: hive_metastore + catalog: customcatalog schema: ${workspace.current_user.short_name} prod: -@@ -42,5 +42,5 @@ +@@ -40,5 +40,5 @@ root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target} variables: - catalog: hive_metastore diff --git a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml index b1fb7f85d42..b8ad3140314 100644 --- a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml +++ b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/databricks.yml @@ -13,8 +13,6 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml index cb3606732b6..a86e4e792a1 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml +++ b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/databricks.yml @@ -8,8 +8,6 @@ include: - resources/*.yml # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml index cb3606732b6..a86e4e792a1 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml +++ b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/databricks.yml @@ -8,8 +8,6 @@ include: - resources/*.yml # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml b/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml index 3eee7ce1c39..299ee6fd9ac 100644 --- a/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml +++ b/acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/databricks.yml @@ -19,8 +19,6 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml b/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml index 9e02553fd29..964e6e704f4 100644 --- a/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml +++ b/acceptance/bundle/templates/telemetry/default-python/out.databricks.yml @@ -13,8 +13,6 @@ artifacts: build: uv build --wheel # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use diff --git a/libs/template/templates/default-minimal/databricks_template_schema.json b/libs/template/templates/default-minimal/databricks_template_schema.json index 2e505392f25..ba74e1160e2 100644 --- a/libs/template/templates/default-minimal/databricks_template_schema.json +++ b/libs/template/templates/default-minimal/databricks_template_schema.json @@ -80,15 +80,16 @@ "description": "Initial language for this project", "enum": [ "python", + "sql", "skip" ], "order": 8 }, "language": { - "//": "Derived from language_choice: for Python, pyproject.toml and tests are included; for others they are excluded", + "//": "Mirrors language_choice: 'python' includes pyproject.toml and tests, 'sql' includes SQL sources, 'skip' includes neither", "skip_prompt_if": {}, "type": "string", - "default": "{{if eq .language_choice \"python\"}}python{{else}}sql{{end}}", + "default": "{{.language_choice}}", "description": "Derived language property for template logic", "order": 9 }, diff --git a/libs/template/templates/default/template/__preamble.tmpl b/libs/template/templates/default/template/__preamble.tmpl index b3f1d25039c..27dcb9973ea 100644 --- a/libs/template/templates/default/template/__preamble.tmpl +++ b/libs/template/templates/default/template/__preamble.tmpl @@ -8,6 +8,7 @@ This file only contains template directives; it is skipped for the actual output {{$notebook_job := eq .include_job "yes"}} {{$python_package := eq .include_python "yes"}} {{$sql_language := eq .language "sql"}} +{{$python_language := eq .language "python"}} {{$lakeflow_only := eq .lakeflow_only "yes"}} {{$pydabs := eq .enable_pydabs "yes"}} {{$has_python_package_dir := and (or $python_package $notebook_job $pipeline) (not $lakeflow_only)}} @@ -35,14 +36,14 @@ This file only contains template directives; it is skipped for the actual output {{skip "{{.project_name}}/src/{{.project_name}}_etl/transformations/*.sql"}} {{end}} -{{if or $sql_language $lakeflow_only}} +{{if or (not $python_language) $lakeflow_only}} {{skip "{{.project_name}}/tests"}} {{skip "{{.project_name}}/fixtures"}} {{else if not (or $python_package $notebook_job $pipeline)}} {{skip "{{.project_name}}/tests/sample_*.py"}} {{end}} -{{if $sql_language}} +{{if not $python_language}} {{skip "{{.project_name}}/pyproject.toml"}} {{end}} diff --git a/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl b/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl index bca68edc2fb..c9c581461e0 100644 --- a/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl @@ -1,12 +1,12 @@ # {{.project_name}} -{{- $skip_tests := or (eq .language "sql") (eq .lakeflow_only "yes")}} +{{- $skip_tests := or (ne .language "python") (eq .lakeflow_only "yes")}} {{- $has_python_package_dir := and (or (eq .include_python "yes") (eq .include_job "yes") (eq .include_pipeline "yes")) (not (eq .lakeflow_only "yes"))}} {{- $is_lakeflow := eq .lakeflow_only "yes"}} The '{{.project_name}}' project was generated by using the {{.template_name}} template. -* `src/`: {{if eq .language "sql"}}SQL{{else}}Python{{end}} source code for this project. +* `src/`: {{if eq .language "sql"}}SQL{{else if eq .language "python"}}Python{{else}}{{end}} source code for this project. {{- if $has_python_package_dir}} * `src/{{.project_name}}/`: Shared Python code that can be used by jobs and pipelines. {{- end}} diff --git a/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl b/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl index ca964877f81..7fb657982aa 100644 --- a/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/databricks.yml.tmpl @@ -27,8 +27,6 @@ artifacts: {{- end}} # Variable declarations. These variables are assigned in the dev/prod targets below. -# Adjust the 'catalog' and 'schema' values in each target to point at the Unity Catalog -# catalog and schema your resources should use. variables: catalog: description: The catalog to use From 8eb31707589a59136ab16e755e7f0e513eab2edd Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:10:11 +0200 Subject: [PATCH 12/17] Update README else path --- .../templates/default/template/{{.project_name}}/README.md.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl b/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl index c9c581461e0..0f40f1ef134 100644 --- a/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl @@ -6,7 +6,7 @@ The '{{.project_name}}' project was generated by using the {{.template_name}} template. -* `src/`: {{if eq .language "sql"}}SQL{{else if eq .language "python"}}Python{{else}}{{end}} source code for this project. +* `src/`: {{if eq .language "sql"}}SQL{{else if eq .language "python"}}Python{{else}}Any{{end}} source code for this project. {{- if $has_python_package_dir}} * `src/{{.project_name}}/`: Shared Python code that can be used by jobs and pipelines. {{- end}} From 29f9cbd8cade101052ca8a5a1710d96ce387ff28 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:11:08 +0200 Subject: [PATCH 13/17] Changelog wording --- .nextchanges/bundles/empty-alias-minimal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nextchanges/bundles/empty-alias-minimal.md b/.nextchanges/bundles/empty-alias-minimal.md index 4a1179f3f82..c7cd17477c5 100644 --- a/.nextchanges/bundles/empty-alias-minimal.md +++ b/.nextchanges/bundles/empty-alias-minimal.md @@ -1 +1 @@ -Simplified the `default-minimal` bundle template: it no longer prompts for a personal schema, and the initial language question now offers a `skip` option for a bare bundle. You can also reach it with the friendlier alias `databricks bundle init empty` ([#5899](https://github.com/databricks/cli/pull/5899)). +Simplified the `default-minimal` bundle template and added an alias `databricks bundle init empty` ([#5899](https://github.com/databricks/cli/pull/5899)). From d98690463d1a9622831a7f8e5b3681959a8c658b Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:19:25 +0200 Subject: [PATCH 14/17] Update golden --- .../default-minimal/output/my_default_minimal/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md index 275cdeb1323..9c97eee08d8 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md @@ -2,7 +2,7 @@ The 'my_default_minimal' project was generated by using the default-minimal template. -* `src/`: source code for this project. +* `src/`: Any source code for this project. * `resources/`: Resource configurations (jobs, pipelines, etc.) ## Getting started From 3b5f3f1c06d65cb82dcde22596f703456f01a1c4 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:32:55 +0200 Subject: [PATCH 15/17] Remove python references from other template choices --- .../.vscode/__builtins__.pyi | 3 -- .../.vscode/extensions.json | 3 +- .../my_default_minimal/.vscode/settings.json | 34 ------------------- .../output/my_default_minimal/README.md | 7 ---- .../output/my_default_minimal/out.gitignore | 5 --- .../my_default_python/.vscode/extensions.json | 4 +-- .../my_default_python/.vscode/extensions.json | 4 +-- .../.vscode/extensions.json | 4 +-- .../.vscode/__builtins__.pyi | 3 -- .../.vscode/extensions.json | 3 +- .../.vscode/settings.json | 34 ------------------- .../my_lakeflow_pipelines/out.gitignore | 5 --- .../lakeflow_project/.vscode/extensions.json | 4 +-- .../my_python_project/.vscode/extensions.json | 4 +-- .../my_sql_project/.vscode/extensions.json | 4 +-- .../default/template/__preamble.tmpl | 1 + .../{{.project_name}}/.gitignore.tmpl | 2 ++ .../{{.project_name}}/.vscode/extensions.json | 7 ---- .../.vscode/extensions.json.tmpl | 7 ++++ .../{settings.json => settings.json.tmpl} | 4 +++ .../template/{{.project_name}}/README.md.tmpl | 2 +- 21 files changed, 29 insertions(+), 115 deletions(-) delete mode 100644 acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/__builtins__.pyi delete mode 100644 acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/__builtins__.pyi delete mode 100644 libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json create mode 100644 libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl rename libs/template/templates/default/template/{{.project_name}}/.vscode/{settings.json => settings.json.tmpl} (94%) diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/__builtins__.pyi b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/__builtins__.pyi deleted file mode 100644 index 0edd5181bc5..00000000000 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/__builtins__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# Typings for Pylance in Visual Studio Code -# see https://github.com/microsoft/pyright/blob/main/docs/builtins.md -from databricks.sdk.runtime import * diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json index 5ba48e79c9b..1f39c330871 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json @@ -1,7 +1,6 @@ { "recommendations": [ "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json index d73c73b5705..d3e814885cb 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json @@ -1,39 +1,5 @@ { - "jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])", - "jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------", - "python.testing.pytestArgs": [ - "." - ], - "files.exclude": { - "**/*.egg-info": true, - "**/__pycache__": true, - ".pytest_cache": true, - "dist": true, - }, "files.associations": { "**/.gitkeep": "markdown" }, - - // Pylance settings (VS Code) - // Set typeCheckingMode to "basic" to enable type checking! - "python.analysis.typeCheckingMode": "off", - "python.analysis.extraPaths": ["src", "lib", "resources"], - "python.analysis.diagnosticMode": "workspace", - "python.analysis.stubPath": ".vscode", - - // Pyright settings (Cursor) - // Set typeCheckingMode to "basic" to enable type checking! - "cursorpyright.analysis.typeCheckingMode": "off", - "cursorpyright.analysis.extraPaths": ["src", "lib", "resources"], - "cursorpyright.analysis.diagnosticMode": "workspace", - "cursorpyright.analysis.stubPath": ".vscode", - - // General Python settings - "python.defaultInterpreterPath": "./.venv/bin/python", - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "[python]": { - "editor.defaultFormatter": "charliermarsh.ruff", - "editor.formatOnSave": true, - }, } diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md index 9c97eee08d8..420f11cf53b 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md @@ -17,13 +17,6 @@ Choose how you want to work on this project: (c) With command line tools, see https://docs.databricks.com/dev-tools/cli/databricks-cli.html -If you're developing with an IDE, dependencies for this project should be installed using uv: - -* Make sure you have the UV package manager installed. - It's an alternative to tools like pip: https://docs.astral.sh/uv/getting-started/installation/. -* Run `uv sync --dev` to install the project's dependencies. - - # Using this project using the CLI The Databricks workspace and IDE extensions provide a graphical interface for working diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/out.gitignore b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/out.gitignore index e566c51f740..622a8811a7b 100644 --- a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/out.gitignore +++ b/acceptance/bundle/templates/default-minimal/output/my_default_minimal/out.gitignore @@ -1,9 +1,4 @@ .databricks/ -build/ -dist/ -__pycache__/ -*.egg-info -.venv/ scratch/** !scratch/README.md **/explorations/** diff --git a/acceptance/bundle/templates/default-python/classic/output/my_default_python/.vscode/extensions.json b/acceptance/bundle/templates/default-python/classic/output/my_default_python/.vscode/extensions.json index 5ba48e79c9b..b958aacfcb4 100644 --- a/acceptance/bundle/templates/default-python/classic/output/my_default_python/.vscode/extensions.json +++ b/acceptance/bundle/templates/default-python/classic/output/my_default_python/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/.vscode/extensions.json b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/.vscode/extensions.json index 5ba48e79c9b..b958aacfcb4 100644 --- a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/.vscode/extensions.json +++ b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/.vscode/extensions.json b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/.vscode/extensions.json index 5ba48e79c9b..b958aacfcb4 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/.vscode/extensions.json +++ b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/__builtins__.pyi b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/__builtins__.pyi deleted file mode 100644 index 0edd5181bc5..00000000000 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/__builtins__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# Typings for Pylance in Visual Studio Code -# see https://github.com/microsoft/pyright/blob/main/docs/builtins.md -from databricks.sdk.runtime import * diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/extensions.json b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/extensions.json index 5ba48e79c9b..1f39c330871 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/extensions.json +++ b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/extensions.json @@ -1,7 +1,6 @@ { "recommendations": [ "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/settings.json b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/settings.json index d73c73b5705..d3e814885cb 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/settings.json +++ b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/.vscode/settings.json @@ -1,39 +1,5 @@ { - "jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])", - "jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------", - "python.testing.pytestArgs": [ - "." - ], - "files.exclude": { - "**/*.egg-info": true, - "**/__pycache__": true, - ".pytest_cache": true, - "dist": true, - }, "files.associations": { "**/.gitkeep": "markdown" }, - - // Pylance settings (VS Code) - // Set typeCheckingMode to "basic" to enable type checking! - "python.analysis.typeCheckingMode": "off", - "python.analysis.extraPaths": ["src", "lib", "resources"], - "python.analysis.diagnosticMode": "workspace", - "python.analysis.stubPath": ".vscode", - - // Pyright settings (Cursor) - // Set typeCheckingMode to "basic" to enable type checking! - "cursorpyright.analysis.typeCheckingMode": "off", - "cursorpyright.analysis.extraPaths": ["src", "lib", "resources"], - "cursorpyright.analysis.diagnosticMode": "workspace", - "cursorpyright.analysis.stubPath": ".vscode", - - // General Python settings - "python.defaultInterpreterPath": "./.venv/bin/python", - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "[python]": { - "editor.defaultFormatter": "charliermarsh.ruff", - "editor.formatOnSave": true, - }, } diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/out.gitignore b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/out.gitignore index e566c51f740..622a8811a7b 100644 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/out.gitignore +++ b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/out.gitignore @@ -1,9 +1,4 @@ .databricks/ -build/ -dist/ -__pycache__/ -*.egg-info -.venv/ scratch/** !scratch/README.md **/explorations/** diff --git a/acceptance/pipelines/e2e/output/lakeflow_project/.vscode/extensions.json b/acceptance/pipelines/e2e/output/lakeflow_project/.vscode/extensions.json index 5ba48e79c9b..b958aacfcb4 100644 --- a/acceptance/pipelines/e2e/output/lakeflow_project/.vscode/extensions.json +++ b/acceptance/pipelines/e2e/output/lakeflow_project/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/pipelines/init/python/output/my_python_project/.vscode/extensions.json b/acceptance/pipelines/init/python/output/my_python_project/.vscode/extensions.json index 5ba48e79c9b..b958aacfcb4 100644 --- a/acceptance/pipelines/init/python/output/my_python_project/.vscode/extensions.json +++ b/acceptance/pipelines/init/python/output/my_python_project/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json index 5ba48e79c9b..b958aacfcb4 100644 --- a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json +++ b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" + "redhat.vscode-yaml" ] } diff --git a/libs/template/templates/default/template/__preamble.tmpl b/libs/template/templates/default/template/__preamble.tmpl index 27dcb9973ea..5bbdc888e2b 100644 --- a/libs/template/templates/default/template/__preamble.tmpl +++ b/libs/template/templates/default/template/__preamble.tmpl @@ -45,6 +45,7 @@ This file only contains template directives; it is skipped for the actual output {{if not $python_language}} {{skip "{{.project_name}}/pyproject.toml"}} + {{skip "{{.project_name}}/.vscode/__builtins__.pyi"}} {{end}} {{if $pydabs}} diff --git a/libs/template/templates/default/template/{{.project_name}}/.gitignore.tmpl b/libs/template/templates/default/template/{{.project_name}}/.gitignore.tmpl index e566c51f740..e400f0256cc 100644 --- a/libs/template/templates/default/template/{{.project_name}}/.gitignore.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/.gitignore.tmpl @@ -1,9 +1,11 @@ .databricks/ +{{- if eq .language "python"}} build/ dist/ __pycache__/ *.egg-info .venv/ +{{- end}} scratch/** !scratch/README.md **/explorations/** diff --git a/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json b/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json deleted file mode 100644 index 5ba48e79c9b..00000000000 --- a/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "recommendations": [ - "databricks.databricks", - "redhat.vscode-yaml", - "charliermarsh.ruff" - ] -} diff --git a/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl b/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl new file mode 100644 index 00000000000..d10d185accb --- /dev/null +++ b/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl @@ -0,0 +1,7 @@ +{ + "recommendations": [ + {{if eq .language "python"}}"charliermarsh.ruff",{{end}} + "databricks.databricks", + "redhat.vscode-yaml" + ] +} diff --git a/libs/template/templates/default/template/{{.project_name}}/.vscode/settings.json b/libs/template/templates/default/template/{{.project_name}}/.vscode/settings.json.tmpl similarity index 94% rename from libs/template/templates/default/template/{{.project_name}}/.vscode/settings.json rename to libs/template/templates/default/template/{{.project_name}}/.vscode/settings.json.tmpl index d73c73b5705..e1dae324628 100644 --- a/libs/template/templates/default/template/{{.project_name}}/.vscode/settings.json +++ b/libs/template/templates/default/template/{{.project_name}}/.vscode/settings.json.tmpl @@ -1,4 +1,5 @@ { +{{- if eq .language "python"}} "jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])", "jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------", "python.testing.pytestArgs": [ @@ -10,9 +11,11 @@ ".pytest_cache": true, "dist": true, }, +{{- end}} "files.associations": { "**/.gitkeep": "markdown" }, +{{- if eq .language "python"}} // Pylance settings (VS Code) // Set typeCheckingMode to "basic" to enable type checking! @@ -36,4 +39,5 @@ "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true, }, +{{- end}} } diff --git a/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl b/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl index 0f40f1ef134..486df502f4e 100644 --- a/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/README.md.tmpl @@ -28,7 +28,7 @@ Choose how you want to work on this project: (c) With command line tools, see https://docs.databricks.com/dev-tools/cli/databricks-cli.html -{{- if not $is_lakeflow}} +{{- if and (eq .language "python") (not $is_lakeflow)}} If you're developing with an IDE, dependencies for this project should be installed using uv: From 53bfd1cc5924316fd85d82b40dc00df4504c5a8c Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:44:10 +0200 Subject: [PATCH 16/17] Add acceptance tests for all three permutations; Fix extension template --- .../default-minimal/python/input.json | 4 + .../{ => python}/out.test.toml | 0 .../default-minimal/{ => python}/output.txt | 0 .../.vscode/__builtins__.pyi | 3 + .../.vscode/extensions.json | 7 ++ .../my_default_minimal/.vscode/settings.json | 39 ++++++++ .../output/my_default_minimal/README.md | 62 ++++++++++++ .../output/my_default_minimal/databricks.yml | 0 .../my_default_minimal/fixtures/.gitkeep | 9 ++ .../output/my_default_minimal/out.gitignore | 10 ++ .../output/my_default_minimal/pyproject.toml | 34 +++++++ .../my_default_minimal/tests/conftest.py | 94 +++++++++++++++++++ .../default-minimal/{ => python}/script | 0 .../default-minimal/{ => skip}/input.json | 0 .../default-minimal/skip/out.test.toml | 3 + .../templates/default-minimal/skip/output.txt | 33 +++++++ .../.vscode/extensions.json | 0 .../my_default_minimal/.vscode/settings.json | 0 .../output/my_default_minimal/README.md | 0 .../output/my_default_minimal/databricks.yml | 41 ++++++++ .../output/my_default_minimal/out.gitignore | 0 .../templates/default-minimal/skip/script | 16 ++++ .../templates/default-minimal/sql/input.json | 4 + .../default-minimal/sql/out.test.toml | 3 + .../templates/default-minimal/sql/output.txt | 33 +++++++ .../.vscode/extensions.json | 6 ++ .../my_default_minimal/.vscode/settings.json | 5 + .../sql/output/my_default_minimal/README.md | 47 ++++++++++ .../output/my_default_minimal/databricks.yml | 41 ++++++++ .../output/my_default_minimal/out.gitignore | 5 + .../templates/default-minimal/sql/script | 16 ++++ .../.vscode/extensions.json.tmpl | 4 +- 32 files changed, 518 insertions(+), 1 deletion(-) create mode 100644 acceptance/bundle/templates/default-minimal/python/input.json rename acceptance/bundle/templates/default-minimal/{ => python}/out.test.toml (100%) rename acceptance/bundle/templates/default-minimal/{ => python}/output.txt (100%) create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/__builtins__.pyi create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/extensions.json create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/settings.json create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/README.md rename acceptance/bundle/templates/default-minimal/{ => python}/output/my_default_minimal/databricks.yml (100%) create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/fixtures/.gitkeep create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/out.gitignore create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/pyproject.toml create mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/tests/conftest.py rename acceptance/bundle/templates/default-minimal/{ => python}/script (100%) rename acceptance/bundle/templates/default-minimal/{ => skip}/input.json (100%) create mode 100644 acceptance/bundle/templates/default-minimal/skip/out.test.toml create mode 100644 acceptance/bundle/templates/default-minimal/skip/output.txt rename acceptance/bundle/templates/default-minimal/{ => skip}/output/my_default_minimal/.vscode/extensions.json (100%) rename acceptance/bundle/templates/default-minimal/{ => skip}/output/my_default_minimal/.vscode/settings.json (100%) rename acceptance/bundle/templates/default-minimal/{ => skip}/output/my_default_minimal/README.md (100%) create mode 100644 acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/databricks.yml rename acceptance/bundle/templates/default-minimal/{ => skip}/output/my_default_minimal/out.gitignore (100%) create mode 100644 acceptance/bundle/templates/default-minimal/skip/script create mode 100644 acceptance/bundle/templates/default-minimal/sql/input.json create mode 100644 acceptance/bundle/templates/default-minimal/sql/out.test.toml create mode 100644 acceptance/bundle/templates/default-minimal/sql/output.txt create mode 100644 acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/extensions.json create mode 100644 acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/settings.json create mode 100644 acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/README.md create mode 100644 acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/databricks.yml create mode 100644 acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/out.gitignore create mode 100644 acceptance/bundle/templates/default-minimal/sql/script diff --git a/acceptance/bundle/templates/default-minimal/python/input.json b/acceptance/bundle/templates/default-minimal/python/input.json new file mode 100644 index 00000000000..c620c3159b5 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/input.json @@ -0,0 +1,4 @@ +{ + "project_name": "my_default_minimal", + "language_choice": "python" +} diff --git a/acceptance/bundle/templates/default-minimal/out.test.toml b/acceptance/bundle/templates/default-minimal/python/out.test.toml similarity index 100% rename from acceptance/bundle/templates/default-minimal/out.test.toml rename to acceptance/bundle/templates/default-minimal/python/out.test.toml diff --git a/acceptance/bundle/templates/default-minimal/output.txt b/acceptance/bundle/templates/default-minimal/python/output.txt similarity index 100% rename from acceptance/bundle/templates/default-minimal/output.txt rename to acceptance/bundle/templates/default-minimal/python/output.txt diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/__builtins__.pyi b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/__builtins__.pyi new file mode 100644 index 00000000000..0edd5181bc5 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/__builtins__.pyi @@ -0,0 +1,3 @@ +# Typings for Pylance in Visual Studio Code +# see https://github.com/microsoft/pyright/blob/main/docs/builtins.md +from databricks.sdk.runtime import * diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/extensions.json b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/extensions.json new file mode 100644 index 00000000000..b958aacfcb4 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "charliermarsh.ruff", + "databricks.databricks", + "redhat.vscode-yaml" + ] +} diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/settings.json b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/settings.json new file mode 100644 index 00000000000..d73c73b5705 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/.vscode/settings.json @@ -0,0 +1,39 @@ +{ + "jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])", + "jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------", + "python.testing.pytestArgs": [ + "." + ], + "files.exclude": { + "**/*.egg-info": true, + "**/__pycache__": true, + ".pytest_cache": true, + "dist": true, + }, + "files.associations": { + "**/.gitkeep": "markdown" + }, + + // Pylance settings (VS Code) + // Set typeCheckingMode to "basic" to enable type checking! + "python.analysis.typeCheckingMode": "off", + "python.analysis.extraPaths": ["src", "lib", "resources"], + "python.analysis.diagnosticMode": "workspace", + "python.analysis.stubPath": ".vscode", + + // Pyright settings (Cursor) + // Set typeCheckingMode to "basic" to enable type checking! + "cursorpyright.analysis.typeCheckingMode": "off", + "cursorpyright.analysis.extraPaths": ["src", "lib", "resources"], + "cursorpyright.analysis.diagnosticMode": "workspace", + "cursorpyright.analysis.stubPath": ".vscode", + + // General Python settings + "python.defaultInterpreterPath": "./.venv/bin/python", + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true, + }, +} diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/README.md b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/README.md new file mode 100644 index 00000000000..8af9ac7e000 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/README.md @@ -0,0 +1,62 @@ +# my_default_minimal + +The 'my_default_minimal' project was generated by using the default-minimal template. + +* `src/`: Python source code for this project. +* `resources/`: Resource configurations (jobs, pipelines, etc.) +* `tests/`: Unit tests for the shared Python code. +* `fixtures/`: Fixtures for data sets (primarily used for testing). + + +## Getting started + +Choose how you want to work on this project: + +(a) Directly in your Databricks workspace, see + https://docs.databricks.com/dev-tools/bundles/workspace. + +(b) Locally with an IDE like Cursor or VS Code, see + https://docs.databricks.com/dev-tools/vscode-ext.html. + +(c) With command line tools, see https://docs.databricks.com/dev-tools/cli/databricks-cli.html + +If you're developing with an IDE, dependencies for this project should be installed using uv: + +* Make sure you have the UV package manager installed. + It's an alternative to tools like pip: https://docs.astral.sh/uv/getting-started/installation/. +* Run `uv sync --dev` to install the project's dependencies. + + +# Using this project using the CLI + +The Databricks workspace and IDE extensions provide a graphical interface for working +with this project. It's also possible to interact with it directly using the CLI: + +1. Authenticate to your Databricks workspace, if you have not done so already: + ``` + $ databricks configure + ``` + +2. To deploy a development copy of this project, type: + ``` + $ databricks bundle deploy --target dev + ``` + (Note that "dev" is the default target, so the `--target` parameter + is optional here.) + + This deploys everything that's defined for this project. + +3. Similarly, to deploy a production copy, type: + ``` + $ databricks bundle deploy --target prod + ``` + +4. To run a job or pipeline, use the "run" command: + ``` + $ databricks bundle run + ``` + +5. Finally, to run tests locally, use `pytest`: + ``` + $ uv run pytest + ``` diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/databricks.yml similarity index 100% rename from acceptance/bundle/templates/default-minimal/output/my_default_minimal/databricks.yml rename to acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/databricks.yml diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/fixtures/.gitkeep b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/fixtures/.gitkeep new file mode 100644 index 00000000000..77a906614cb --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/fixtures/.gitkeep @@ -0,0 +1,9 @@ +# Test fixtures directory + +Add JSON or CSV files here. In tests, use them with `load_fixture()`: + +``` +def test_using_fixture(load_fixture): + data = load_fixture("my_data.json") + assert len(data) >= 1 +``` diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/out.gitignore b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/out.gitignore new file mode 100644 index 00000000000..e566c51f740 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/out.gitignore @@ -0,0 +1,10 @@ +.databricks/ +build/ +dist/ +__pycache__/ +*.egg-info +.venv/ +scratch/** +!scratch/README.md +**/explorations/** +**/!explorations/README.md diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/pyproject.toml b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/pyproject.toml new file mode 100644 index 00000000000..4678f9c4368 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/pyproject.toml @@ -0,0 +1,34 @@ +[project] +name = "my_default_minimal" +version = "0.0.1" +authors = [{ name = "[USERNAME]" }] +requires-python = ">=3.10,<3.13" +dependencies = [ + # Any dependencies for jobs and pipelines in this project can be added here + # See also https://docs.databricks.com/dev-tools/bundles/library-dependencies + # + # LIMITATION: for pipelines, dependencies are cached during development; + # add dependencies to the 'environment' section of your pipeline.yml file instead +] + +[dependency-groups] +dev = [ + "pytest", + "ruff", + "databricks-dlt", + "databricks-connect>=15.4,<15.5", + "ipykernel", +] + +[project.scripts] +main = "my_default_minimal.main:main" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src"] + +[tool.ruff] +line-length = 120 diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/tests/conftest.py b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/tests/conftest.py new file mode 100644 index 00000000000..72ebfeb5666 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/tests/conftest.py @@ -0,0 +1,94 @@ +"""This file configures pytest, initializes Databricks Connect, and provides fixtures for Spark and loading test data.""" + +import os, sys, pathlib +from contextlib import contextmanager + + +try: + from databricks.connect import DatabricksSession + from databricks.sdk import WorkspaceClient + from pyspark.sql import SparkSession + import pytest + import json + import csv + import os +except ImportError: + raise ImportError( + "Test dependencies not found.\n\nRun tests using 'uv run pytest'. See http://docs.astral.sh/uv to learn more about uv." + ) + + +@pytest.fixture() +def spark() -> SparkSession: + """Provide a SparkSession fixture for tests. + + Minimal example: + def test_uses_spark(spark): + df = spark.createDataFrame([(1,)], ["x"]) + assert df.count() == 1 + """ + return DatabricksSession.builder.getOrCreate() + + +@pytest.fixture() +def load_fixture(spark: SparkSession): + """Provide a callable to load JSON or CSV from fixtures/ directory. + + Example usage: + + def test_using_fixture(load_fixture): + data = load_fixture("my_data.json") + assert data.count() >= 1 + """ + + def _loader(filename: str): + path = pathlib.Path(__file__).parent.parent / "fixtures" / filename + suffix = path.suffix.lower() + if suffix == ".json": + rows = json.loads(path.read_text()) + return spark.createDataFrame(rows) + if suffix == ".csv": + with path.open(newline="") as f: + rows = list(csv.DictReader(f)) + return spark.createDataFrame(rows) + raise ValueError(f"Unsupported fixture type for: {filename}") + + return _loader + + +def _enable_fallback_compute(): + """Enable serverless compute if no compute is specified.""" + conf = WorkspaceClient().config + if conf.serverless_compute_id or conf.cluster_id or os.environ.get("SPARK_REMOTE"): + return + + url = "https://docs.databricks.com/dev-tools/databricks-connect/cluster-config" + print("☁️ no compute specified, falling back to serverless compute", file=sys.stderr) + print(f" see {url} for manual configuration", file=sys.stdout) + + os.environ["DATABRICKS_SERVERLESS_COMPUTE_ID"] = "auto" + + +@contextmanager +def _allow_stderr_output(config: pytest.Config): + """Temporarily disable pytest output capture.""" + capman = config.pluginmanager.get_plugin("capturemanager") + if capman: + with capman.global_and_fixture_disabled(): + yield + else: + yield + + +def pytest_configure(config: pytest.Config): + """Configure pytest session.""" + with _allow_stderr_output(config): + _enable_fallback_compute() + + # Initialize Spark session eagerly, so it is available even when + # SparkSession.builder.getOrCreate() is used. For DB Connect 15+, + # we validate version compatibility with the remote cluster. + if hasattr(DatabricksSession.builder, "validateSession"): + DatabricksSession.builder.validateSession().getOrCreate() + else: + DatabricksSession.builder.getOrCreate() diff --git a/acceptance/bundle/templates/default-minimal/script b/acceptance/bundle/templates/default-minimal/python/script similarity index 100% rename from acceptance/bundle/templates/default-minimal/script rename to acceptance/bundle/templates/default-minimal/python/script diff --git a/acceptance/bundle/templates/default-minimal/input.json b/acceptance/bundle/templates/default-minimal/skip/input.json similarity index 100% rename from acceptance/bundle/templates/default-minimal/input.json rename to acceptance/bundle/templates/default-minimal/skip/input.json diff --git a/acceptance/bundle/templates/default-minimal/skip/out.test.toml b/acceptance/bundle/templates/default-minimal/skip/out.test.toml new file mode 100644 index 00000000000..f784a183258 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/skip/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/bundle/templates/default-minimal/skip/output.txt b/acceptance/bundle/templates/default-minimal/skip/output.txt new file mode 100644 index 00000000000..06eb69b9a11 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/skip/output.txt @@ -0,0 +1,33 @@ + +>>> [CLI] bundle init default-minimal --config-file ./input.json --output-dir output +Welcome to the minimal Declarative Automation Bundle template! + +This template creates a minimal project structure without sample code, ideal for advanced users. +(For getting started with Python or SQL code, use the default-python or default-sql templates instead.) + +Your workspace at [DATABRICKS_URL] is used for initialization. +(See https://docs.databricks.com/dev-tools/cli/profiles.html for how to change your profile.) + +✨ Your new project has been created in the 'my_default_minimal' directory! + +To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html. + +>>> [CLI] bundle validate -t dev +Name: my_default_minimal +Target: dev +Workspace: + Host: [DATABRICKS_URL] + User: [USERNAME] + Path: /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/dev + +Validation OK! + +>>> [CLI] bundle validate -t prod +Name: my_default_minimal +Target: prod +Workspace: + Host: [DATABRICKS_URL] + User: [USERNAME] + Path: /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/prod + +Validation OK! diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/.vscode/extensions.json similarity index 100% rename from acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json rename to acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/.vscode/extensions.json diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/.vscode/settings.json similarity index 100% rename from acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json rename to acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/.vscode/settings.json diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/README.md similarity index 100% rename from acceptance/bundle/templates/default-minimal/output/my_default_minimal/README.md rename to acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/README.md diff --git a/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/databricks.yml b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/databricks.yml new file mode 100644 index 00000000000..ec72bde8b31 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/databricks.yml @@ -0,0 +1,41 @@ +# This is a Declarative Automation Bundle definition for my_default_minimal. +# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. +bundle: + name: my_default_minimal + uuid: [UUID] + +include: + - resources/*.yml + +# Variable declarations. These variables are assigned in the dev/prod targets below. +variables: + catalog: + description: The catalog to use + schema: + description: The schema to use + +targets: + dev: + # The default target uses 'mode: development' to create a development copy. + # - Deployed resources get prefixed with '[dev my_user_name]' + # - Any job schedules and triggers are paused by default. + # See also https://docs.databricks.com/dev-tools/bundles/deployment-modes.html. + mode: development + default: true + workspace: + host: [DATABRICKS_URL] + variables: + catalog: hive_metastore + schema: ${workspace.current_user.short_name} + prod: + mode: production + workspace: + host: [DATABRICKS_URL] + # We explicitly deploy to /Workspace/Users/[USERNAME] to make sure we only have a single copy. + root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target} + variables: + catalog: hive_metastore + schema: prod + permissions: + - user_name: [USERNAME] + level: CAN_MANAGE diff --git a/acceptance/bundle/templates/default-minimal/output/my_default_minimal/out.gitignore b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/out.gitignore similarity index 100% rename from acceptance/bundle/templates/default-minimal/output/my_default_minimal/out.gitignore rename to acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/out.gitignore diff --git a/acceptance/bundle/templates/default-minimal/skip/script b/acceptance/bundle/templates/default-minimal/skip/script new file mode 100644 index 00000000000..bce20c6ed9d --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/skip/script @@ -0,0 +1,16 @@ +trace $CLI bundle init default-minimal --config-file ./input.json --output-dir output + +cd output/my_default_minimal + +# Verify that empty directories are preserved +[ -d "src" ] || exit 1 +[ -d "resources" ] || exit 1 + +trace $CLI bundle validate -t dev +trace $CLI bundle validate -t prod + +# Do not affect this repository's git behaviour #2318 +mv .gitignore out.gitignore +rm -r .databricks + +cd ../../ diff --git a/acceptance/bundle/templates/default-minimal/sql/input.json b/acceptance/bundle/templates/default-minimal/sql/input.json new file mode 100644 index 00000000000..8a354d617c9 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/input.json @@ -0,0 +1,4 @@ +{ + "project_name": "my_default_minimal", + "language_choice": "sql" +} diff --git a/acceptance/bundle/templates/default-minimal/sql/out.test.toml b/acceptance/bundle/templates/default-minimal/sql/out.test.toml new file mode 100644 index 00000000000..f784a183258 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/bundle/templates/default-minimal/sql/output.txt b/acceptance/bundle/templates/default-minimal/sql/output.txt new file mode 100644 index 00000000000..06eb69b9a11 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/output.txt @@ -0,0 +1,33 @@ + +>>> [CLI] bundle init default-minimal --config-file ./input.json --output-dir output +Welcome to the minimal Declarative Automation Bundle template! + +This template creates a minimal project structure without sample code, ideal for advanced users. +(For getting started with Python or SQL code, use the default-python or default-sql templates instead.) + +Your workspace at [DATABRICKS_URL] is used for initialization. +(See https://docs.databricks.com/dev-tools/cli/profiles.html for how to change your profile.) + +✨ Your new project has been created in the 'my_default_minimal' directory! + +To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html. + +>>> [CLI] bundle validate -t dev +Name: my_default_minimal +Target: dev +Workspace: + Host: [DATABRICKS_URL] + User: [USERNAME] + Path: /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/dev + +Validation OK! + +>>> [CLI] bundle validate -t prod +Name: my_default_minimal +Target: prod +Workspace: + Host: [DATABRICKS_URL] + User: [USERNAME] + Path: /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/prod + +Validation OK! diff --git a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/extensions.json b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/extensions.json new file mode 100644 index 00000000000..1f39c330871 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "databricks.databricks", + "redhat.vscode-yaml" + ] +} diff --git a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/settings.json b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/settings.json new file mode 100644 index 00000000000..d3e814885cb --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "**/.gitkeep": "markdown" + }, +} diff --git a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/README.md b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/README.md new file mode 100644 index 00000000000..ace4bdc7d74 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/README.md @@ -0,0 +1,47 @@ +# my_default_minimal + +The 'my_default_minimal' project was generated by using the default-minimal template. + +* `src/`: SQL source code for this project. +* `resources/`: Resource configurations (jobs, pipelines, etc.) + +## Getting started + +Choose how you want to work on this project: + +(a) Directly in your Databricks workspace, see + https://docs.databricks.com/dev-tools/bundles/workspace. + +(b) Locally with an IDE like Cursor or VS Code, see + https://docs.databricks.com/dev-tools/vscode-ext.html. + +(c) With command line tools, see https://docs.databricks.com/dev-tools/cli/databricks-cli.html + +# Using this project using the CLI + +The Databricks workspace and IDE extensions provide a graphical interface for working +with this project. It's also possible to interact with it directly using the CLI: + +1. Authenticate to your Databricks workspace, if you have not done so already: + ``` + $ databricks configure + ``` + +2. To deploy a development copy of this project, type: + ``` + $ databricks bundle deploy --target dev + ``` + (Note that "dev" is the default target, so the `--target` parameter + is optional here.) + + This deploys everything that's defined for this project. + +3. Similarly, to deploy a production copy, type: + ``` + $ databricks bundle deploy --target prod + ``` + +4. To run a job or pipeline, use the "run" command: + ``` + $ databricks bundle run + ``` diff --git a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/databricks.yml b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/databricks.yml new file mode 100644 index 00000000000..ec72bde8b31 --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/databricks.yml @@ -0,0 +1,41 @@ +# This is a Declarative Automation Bundle definition for my_default_minimal. +# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation. +bundle: + name: my_default_minimal + uuid: [UUID] + +include: + - resources/*.yml + +# Variable declarations. These variables are assigned in the dev/prod targets below. +variables: + catalog: + description: The catalog to use + schema: + description: The schema to use + +targets: + dev: + # The default target uses 'mode: development' to create a development copy. + # - Deployed resources get prefixed with '[dev my_user_name]' + # - Any job schedules and triggers are paused by default. + # See also https://docs.databricks.com/dev-tools/bundles/deployment-modes.html. + mode: development + default: true + workspace: + host: [DATABRICKS_URL] + variables: + catalog: hive_metastore + schema: ${workspace.current_user.short_name} + prod: + mode: production + workspace: + host: [DATABRICKS_URL] + # We explicitly deploy to /Workspace/Users/[USERNAME] to make sure we only have a single copy. + root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target} + variables: + catalog: hive_metastore + schema: prod + permissions: + - user_name: [USERNAME] + level: CAN_MANAGE diff --git a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/out.gitignore b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/out.gitignore new file mode 100644 index 00000000000..622a8811a7b --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/out.gitignore @@ -0,0 +1,5 @@ +.databricks/ +scratch/** +!scratch/README.md +**/explorations/** +**/!explorations/README.md diff --git a/acceptance/bundle/templates/default-minimal/sql/script b/acceptance/bundle/templates/default-minimal/sql/script new file mode 100644 index 00000000000..bce20c6ed9d --- /dev/null +++ b/acceptance/bundle/templates/default-minimal/sql/script @@ -0,0 +1,16 @@ +trace $CLI bundle init default-minimal --config-file ./input.json --output-dir output + +cd output/my_default_minimal + +# Verify that empty directories are preserved +[ -d "src" ] || exit 1 +[ -d "resources" ] || exit 1 + +trace $CLI bundle validate -t dev +trace $CLI bundle validate -t prod + +# Do not affect this repository's git behaviour #2318 +mv .gitignore out.gitignore +rm -r .databricks + +cd ../../ diff --git a/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl b/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl index d10d185accb..f1cf722e7fc 100644 --- a/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl +++ b/libs/template/templates/default/template/{{.project_name}}/.vscode/extensions.json.tmpl @@ -1,6 +1,8 @@ { "recommendations": [ - {{if eq .language "python"}}"charliermarsh.ruff",{{end}} +{{- if eq .language "python"}} + "charliermarsh.ruff", +{{- end}} "databricks.databricks", "redhat.vscode-yaml" ] From d26e137c3835c1ec36c1e440612869b5d907548b Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 17 Jul 2026 11:52:46 +0200 Subject: [PATCH 17/17] Update pipeline tests --- .../my_sql_project/.vscode/__builtins__.pyi | 3 -- .../my_sql_project/.vscode/extensions.json | 1 - .../my_sql_project/.vscode/settings.json | 34 ------------------- .../sql/output/my_sql_project/out.gitignore | 5 --- 4 files changed, 43 deletions(-) delete mode 100644 acceptance/pipelines/init/sql/output/my_sql_project/.vscode/__builtins__.pyi diff --git a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/__builtins__.pyi b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/__builtins__.pyi deleted file mode 100644 index 0edd5181bc5..00000000000 --- a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/__builtins__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# Typings for Pylance in Visual Studio Code -# see https://github.com/microsoft/pyright/blob/main/docs/builtins.md -from databricks.sdk.runtime import * diff --git a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json index b958aacfcb4..1f39c330871 100644 --- a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json +++ b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/extensions.json @@ -1,6 +1,5 @@ { "recommendations": [ - "charliermarsh.ruff", "databricks.databricks", "redhat.vscode-yaml" ] diff --git a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/settings.json b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/settings.json index d73c73b5705..d3e814885cb 100644 --- a/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/settings.json +++ b/acceptance/pipelines/init/sql/output/my_sql_project/.vscode/settings.json @@ -1,39 +1,5 @@ { - "jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])", - "jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------", - "python.testing.pytestArgs": [ - "." - ], - "files.exclude": { - "**/*.egg-info": true, - "**/__pycache__": true, - ".pytest_cache": true, - "dist": true, - }, "files.associations": { "**/.gitkeep": "markdown" }, - - // Pylance settings (VS Code) - // Set typeCheckingMode to "basic" to enable type checking! - "python.analysis.typeCheckingMode": "off", - "python.analysis.extraPaths": ["src", "lib", "resources"], - "python.analysis.diagnosticMode": "workspace", - "python.analysis.stubPath": ".vscode", - - // Pyright settings (Cursor) - // Set typeCheckingMode to "basic" to enable type checking! - "cursorpyright.analysis.typeCheckingMode": "off", - "cursorpyright.analysis.extraPaths": ["src", "lib", "resources"], - "cursorpyright.analysis.diagnosticMode": "workspace", - "cursorpyright.analysis.stubPath": ".vscode", - - // General Python settings - "python.defaultInterpreterPath": "./.venv/bin/python", - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "[python]": { - "editor.defaultFormatter": "charliermarsh.ruff", - "editor.formatOnSave": true, - }, } diff --git a/acceptance/pipelines/init/sql/output/my_sql_project/out.gitignore b/acceptance/pipelines/init/sql/output/my_sql_project/out.gitignore index e566c51f740..622a8811a7b 100644 --- a/acceptance/pipelines/init/sql/output/my_sql_project/out.gitignore +++ b/acceptance/pipelines/init/sql/output/my_sql_project/out.gitignore @@ -1,9 +1,4 @@ .databricks/ -build/ -dist/ -__pycache__/ -*.egg-info -.venv/ scratch/** !scratch/README.md **/explorations/**