Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

### Bundles
* Add validation that served_models and served_entities are not used at the same time. Add client side translation logic. ([#3880](https://github.com/databricks/cli/pull/3880))
* Update templates to use serverless environment version 4 and matching Python version ([#3897](https://github.com/databricks/cli/pull/3897))

### API Changes
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ resources:
environments:
- environment_key: default
spec:
environment_version: "2"
environment_version: "4"
dependencies:
- dbt-databricks>=1.8.0,<2.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- environments:
- - environment_key: default
- spec:
- environment_version: "2"
- environment_version: "4"
- dependencies:
- # By default we just include the .whl file generated for the my_default_python package.
- # See https://docs.databricks.com/dev-tools/bundles/library-dependencies.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "my_default_python"
version = "0.0.1"
authors = [{ name = "[USERNAME]" }]
requires-python = ">=3.10,<=3.13"
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"dependencies": [
"--editable .."
],
"environment_version": "2"
"environment_version": "4"
},
"language": "python",
"notebookMetadata": {
Expand Down Expand Up @@ -141,7 +141,7 @@
},
"language_info": {
"name": "python",
"version": "3.11.4"
"version": "3.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "my_default_python"
version = "0.0.1"
authors = [{ name = "[USERNAME]" }]
requires-python = ">=3.10,<=3.13"
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resources:
environments:
- environment_key: default
spec:
environment_version: "2"
environment_version: "4"
dependencies:
# By default we just include the .whl file generated for the my_default_python package.
# See https://docs.databricks.com/dev-tools/bundles/library-dependencies.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"dependencies": [
"--editable .."
],
"environment_version": "2"
"environment_version": "4"
},
"language": "python",
"notebookMetadata": {
Expand Down Expand Up @@ -141,7 +141,7 @@
},
"language_info": {
"name": "python",
"version": "3.11.4"
"version": "3.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "my_lakeflow_pipelines"
version = "0.0.1"
authors = [{ name = "[USERNAME]" }]
requires-python = ">=3.10,<=3.13"
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ resources:
environments:
- environment_key: default
spec:
environment_version: "2"
environment_version: "4"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "my_lakeflow_pipelines"
version = "0.0.1"
authors = [{ name = "[USERNAME]" }]
requires-python = ">=3.10,<=3.13"
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ resources:
environments:
- environment_key: default
spec:
environment_version: "2"
environment_version: "4"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "my_pydabs"
version = "0.0.1"
authors = [{ name = "[USERNAME]" }]
requires-python = ">=3.10,<=3.13"
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
Expand Down
7 changes: 7 additions & 0 deletions libs/template/templates/dbt-sql/library/versions.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
{{define "latest_lts_db_connect_version_spec" -}}
>=15.4,<15.5
{{- end}}

{{/* The serverless environment version to use.
* See https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/
*/}}
{{define "serverless_environment_version" -}}
4
{{- end}}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ resources:
environments:
- environment_key: default
spec:
environment_version: "2"
environment_version: "{{template "serverless_environment_version"}}"
dependencies:
- dbt-databricks>=1.8.0,<2.0.0
{{- end }}
34 changes: 29 additions & 5 deletions libs/template/templates/default/library/versions.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{/* The latest LTS DBR version; this should be updated a few months after each LTS.
* See https://docs.databricks.com/release-notes/runtime/index.html for available versions.
*/}}
{{define "latest_lts_dbr_version" -}}
16.4.x-scala2.12
Expand All @@ -11,16 +12,39 @@
* only connect to compute of that same version and higher. If the version is
* deemed too old, customers can update the version themselves after initializing
* the template.
*
* See https://docs.databricks.com/dev-tools/databricks-connect/python/index.html#requirements
* for DB Connect release notes and version compatibility.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can it make sense to change how DB Connect version is selected for serverless-only bundles?

*/}}
{{define "conservative_db_connect_version_spec" -}}
>=15.4,<15.5
{{- end}}

{{/* DB Connect 15 only supports versions up to 3.13 because of a limitation in
* pyarrow: https://arrow.apache.org/docs/python/install.html#python-compatibility
{{define "latest_databricks_bundles_version" -}}0.276.0{{- end}}

{{/* The serverless environment version to use.
* See https://docs.databricks.com/release-notes/runtime/index.html for available versions.
*/}}
{{define "conservative_db_connect_python_version_spec" -}}
>=3.10,<=3.13
{{define "serverless_environment_version" -}}
4
{{- end}}

{{define "latest_databricks_bundles_version" -}}0.276.0{{- end}}
{{/* Python version specification for the template.
* This needs to be compatible with the version of DB Connect and the serverless_environment_version.
*
* Serverless environment version 4 (and upcoming v5), DBR 16, and DBR 17 all use Python 3.12.
* DB Connect 15 supports all of these and is compatible with Python 3.10-3.12.
*
* We use >=3.10,<3.13 rather than pinning to 3.12 specifically because overly narrow pinning
* means users always need to use uv or similar tools to install the exact version. A broader
* range improves usability while maintaining compatibility with both DB Connect and serverless.
*/}}
{{define "python_version_spec" -}}
>=3.10,<3.13
{{- end}}

{{/* The default Python version used in notebook metadata.
*/}}
{{define "default_python_version" -}}
3.12
{{- end}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "{{.project_name}}"
version = "0.0.1"
authors = [{ name = "{{user_name}}" }]
requires-python = "{{template "conservative_db_connect_python_version_spec"}}"
requires-python = "{{template "python_version_spec"}}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Below, there is a line with "databricks-connect>=15.4,<15.5". Perhaps it's worth adding a short version of the DB Connect comment from versions.tmpl?

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ resources:
environments:
- environment_key: default
spec:
environment_version: "2"
environment_version: "{{template "serverless_environment_version"}}"
{{- if $python_package}}
dependencies:
# By default we just include the .whl file generated for the {{.project_name}} package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ sample_job = Job.from_dict(
{
"environment_key": "default",
"spec": {
"environment_version": "2",
"environment_version": "{{template "serverless_environment_version"}}",
{{- if $python_package}}
"dependencies": [
# By default we just include the .whl file generated for the {{.project_name}} package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
{{- /* Make sure that this file always gets any library dependencies (when using serverless)*/}}
"--editable .."
],
"environment_version": "2"
"environment_version": "{{template "serverless_environment_version"}}"
},
"language": "python",
"notebookMetadata": {
Expand Down Expand Up @@ -146,7 +146,7 @@
},
"language_info": {
"name": "python",
"version": "3.11.4"
"version": "{{template "default_python_version"}}"
}
},
"nbformat": 4,
Expand Down