Skip to content

[Python] Add volumes support - #3383

Merged
kanterov merged 1 commit into
mainfrom
add-volumes
Aug 21, 2025
Merged

[Python] Add volumes support#3383
kanterov merged 1 commit into
mainfrom
add-volumes

Conversation

@kanterov

Copy link
Copy Markdown
Collaborator

Changes

Add volume resource type support to Python

Why

It makes it possible to define volumes with Python code, similar to jobs and pipelines

Tests

Acceptance and unit tests

from dataclasses import replace

from databricks.bundles.core import volume_mutator
from databricks.bundles.catalog import Volume

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

JSON schema volumes are located in the "catalog" namespace. We need to decide whether to vendor them into a separate namespace (e.g. databricks.bundles.volumes) or co-locate them with "catalog" objects.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

@pietern I think databricks.bundles.volumes will be a better option. We should keep each resource contained. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think following the schema makes it easier to navigate for someone already familiar with any of the SDKs, no?

What's the advantage of separate module per each resource?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

We are switching to a model where each service will have an independent set of classes. That is how SDK v1, which is replacing SDK v0, is built. So, if we want to be consistent with it, we should follow the same approach. It simplifies making major/breaking changes because they can be isolated to a particular namespace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 to that. Prefer separate namespace over using catalog now and having to retrofit one later when the SDK moves on. Mental model is also simpler, as the "boundary" here is the resource.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator

Run: 17132097479

Env✅‌pass🙈‌skip
✅‌aws linux310487
✅‌aws windows311486
✅‌aws-ucws linux424385
✅‌aws-ucws windows425384
✅‌azure linux310486
✅‌azure windows311485
✅‌azure-ucws linux426382
✅‌azure-ucws windows427381
✅‌gcp linux309488
✅‌gcp windows310487

from dataclasses import replace

from databricks.bundles.core import volume_mutator
from databricks.bundles.catalog import Volume

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think following the schema makes it easier to navigate for someone already familiar with any of the SDKs, no?

What's the advantage of separate module per each resource?

@pieternpietern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

from dataclasses import replace

from databricks.bundles.core import volume_mutator
from databricks.bundles.catalog import Volume

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 to that. Prefer separate namespace over using catalog now and having to retrofit one later when the SDK moves on. Mental model is also simpler, as the "boundary" here is the resource.

@kanterov
kanterov enabled auto-merge August 21, 2025 16:13
@kanterov
kanterov added this pull request to the merge queueAug 21, 2025
github-merge-queueBot pushed a commit that referenced this pull request Aug 21, 2025
## Changes
Add volume resource type support to Python
## Why
It makes it possible to define volumes with Python code, similar to jobs
and pipelines
## Tests
Acceptance and unit tests
Merged via the queue into main with commit 0297797Aug 21, 2025
19 checks passed
@kanterov
kanterov deleted the add-volumes branch August 21, 2025 16:47
deco-sdk-taggingBot added a commit that referenced this pull request Aug 27, 2025
## Release v0.266.0
### Notable Changes
* Breaking change: DABs now return an error when paths are incorrectly defined relative to the job or
pipeline definition location instead of the configuration file location. Previously, the CLI would show a
warning and fallback to resolving the path relative to the resource location. Users must update their bundle
configurations to define all relative paths relative to the configuration file where the path is specified.
See more details here: ([#3225](#3225))
* Add support volumes in Python support ([#3383])(#3383))
### Bundles
* [Breaking Change] Remove deprecated path fallback mechanism for jobs and pipelines ([#3225](#3225))
* Add support for Lakebase synced database tables in DABs ([#3467](#3467))
* Rename Delta Live Tables to Lakeflow Declarative Pipelines in the default-python template ([#3476](#3476)).
* Fixed bundle init not working on Standard tier ([#3496](#3496))
denik pushed a commit that referenced this pull request May 20, 2026
## Changes
Add volume resource type support to Python
## Why
It makes it possible to define volumes with Python code, similar to jobs
and pipelines
## Tests
Acceptance and unit tests
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.266.0
### Notable Changes
* Breaking change: DABs now return an error when paths are incorrectly defined relative to the job or
pipeline definition location instead of the configuration file location. Previously, the CLI would show a
warning and fallback to resolving the path relative to the resource location. Users must update their bundle
configurations to define all relative paths relative to the configuration file where the path is specified.
See more details here: ([#3225](#3225))
* Add support volumes in Python support ([#3383])(#3383))
### Bundles
* [Breaking Change] Remove deprecated path fallback mechanism for jobs and pipelines ([#3225](#3225))
* Add support for Lakebase synced database tables in DABs ([#3467](#3467))
* Rename Delta Live Tables to Lakeflow Declarative Pipelines in the default-python template ([#3476](#3476)).
* Fixed bundle init not working on Standard tier ([#3496](#3496))
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

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