-
Notifications
You must be signed in to change notification settings - Fork 201
Allow configuring cascade deletion in DABs
#5846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
7b28c18
7df2def
9a2436c
5021a52
cb61ad7
423ca32
35d64f9
c59d737
c8cbb9b
6ff85f1
9b80091
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| bundle: | ||
| name: test-pipeline-destroy-cascade | ||
| resources: | ||
| pipelines: | ||
| my_pipeline: | ||
| name: test-pipeline-cascade | ||
| cascade: false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you make sure the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack will put this change in a follow-up PR. |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
|
|
||
| === Deploy a pipeline configured with cascade: false | ||
| >>> [CLI] pipelines deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| View your pipeline my_pipeline here: [DATABRICKS_URL]/pipelines/[UUID]?w=[NUMID] | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/pipelines", | ||
| "body": { | ||
| "channel": "CURRENT", | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default/state/metadata.json" | ||
| }, | ||
| "edition": "ADVANCED", | ||
| "name": "test-pipeline-cascade" | ||
| } | ||
| } | ||
|
|
||
| === Change only cascade (false -> true): expect a state-only update, no pipeline update API call | ||
| >>> [CLI] pipelines deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| View your pipeline my_pipeline here: [DATABRICKS_URL]/pipelines/[UUID]?w=[NUMID] | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines | ||
|
|
||
| === Destroy: delete reads the updated cascade=true from persisted state | ||
| >>> [CLI] pipelines destroy --auto-approve | ||
|
lennartkats-db marked this conversation as resolved.
|
||
| The following resources will be deleted: | ||
| delete resources.pipelines.my_pipeline | ||
|
|
||
| This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the | ||
| Streaming Tables (STs) and Materialized Views (MVs) managed by them: | ||
| delete resources.pipelines.my_pipeline | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.0/pipelines/[UUID]", | ||
| "q": { | ||
| "cascade": "true" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| title "Deploy a pipeline configured with cascade: false" | ||
| trace $CLI pipelines deploy | ||
|
|
||
| # Flush the deploy requests: cascade is delete-time-only, so the create request must not carry it. | ||
| trace print_requests.py //api/2.0/pipelines | ||
|
|
||
| title "Change only cascade (false -> true): expect a state-only update, no pipeline update API call" | ||
| update_file.py databricks.yml "cascade: false" "cascade: true" | ||
| trace $CLI pipelines deploy | ||
| # No POST/PATCH to /pipelines is expected here; the cascade-only change is persisted to state. | ||
| trace print_requests.py //api/2.0/pipelines | ||
|
|
||
| title "Destroy: delete reads the updated cascade=true from persisted state" | ||
| trace $CLI pipelines destroy --auto-approve | ||
| trace print_requests.py //api/2.0/pipelines |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # --cascade only affects the direct engine's delete request; the terraform engine deletes | ||
| # pipelines through the provider and ignores it. Restrict to direct so the recorded request | ||
|
ronaldz-db marked this conversation as resolved.
Outdated
|
||
| # is meaningful and the single variant does not diverge. | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
| RecordRequests = true | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.