Skip to content

Commit 45710fc

Browse files
authored
acc: Volumes references to catalog are not resolved as depends_on if used var.catalog syntax (#4846)
## Changes Added a test to confirm columes references to catalog are not resolved as depends_on if used `${var.catalog}` syntax ## Why This is unexpected that `${var.catalog}` does not work but `${resouces.catalogs.catalog...}` does ## Tests Added an acceptance test <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
1 parent 651ab26 commit 45710fc

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
bundle:
2+
name: catalog-var-ref
3+
4+
variables:
5+
catalog:
6+
description: Unity Catalog name
7+
default: main
8+
9+
resources:
10+
catalogs:
11+
main_catalog:
12+
name: ${var.catalog}
13+
comment: "My catalog"
14+
storage_root: s3://my-s3-path/dbx/${var.catalog}
15+
#
16+
schemas:
17+
raw_schema:
18+
name: raw
19+
catalog_name: ${var.catalog}
20+
21+
volumes:
22+
metadata:
23+
name: metadata
24+
catalog_name: ${var.catalog}
25+
schema_name: raw
26+
volume_type: EXTERNAL
27+
storage_location: s3://my-s3-path/${var.catalog}_raw

acceptance/bundle/resources/volumes/catalog-var-ref/out.test.toml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"plan_version": 2,
3+
"cli_version": "[DEV_VERSION]",
4+
"plan": {
5+
"resources.catalogs.main_catalog": {
6+
"action": "create",
7+
"new_state": {
8+
"value": {
9+
"comment": "My catalog",
10+
"name": "main",
11+
"storage_root": "s3://my-s3-path/dbx/main"
12+
}
13+
}
14+
},
15+
"resources.schemas.raw_schema": {
16+
"depends_on": [
17+
{
18+
"node": "resources.catalogs.main_catalog",
19+
"label": "${resources.catalogs.main_catalog.name}"
20+
}
21+
],
22+
"action": "create",
23+
"new_state": {
24+
"value": {
25+
"catalog_name": "main",
26+
"name": "raw"
27+
}
28+
}
29+
},
30+
"resources.volumes.metadata": {
31+
"action": "create",
32+
"new_state": {
33+
"value": {
34+
"catalog_name": "main",
35+
"name": "metadata",
36+
"schema_name": "raw",
37+
"storage_location": "s3://my-s3-path/main_raw",
38+
"volume_type": "EXTERNAL"
39+
}
40+
}
41+
}
42+
}
43+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$CLI bundle plan -o json
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Badness = "No depends_on for volume resource"
2+
3+
Local = true
4+
Cloud = false
5+
RecordRequests = false
6+
7+
[EnvMatrix]
8+
DATABRICKS_BUNDLE_ENGINE = ["direct"]

0 commit comments

Comments
 (0)