Skip to content

Commit 00de70c

Browse files
authored
direct: Fix processing of configs with dots in map keys (#4977)
## Changes When calculating the plan, direct engine users dyn.Walk to figure out where remaining references are. It is used dyn.Path.String() method which lost information for configuration with dots in map keys. Fixed the plan to convert dyn.Path to structpath.PathNode directly which preserves nodes. ## Why Fixes #4960 ## Tests New dedicate test that shows that this type of config did not work on direct engine (even without migration). New invariant test config with dots in maps keys to test the migration and other scenarios.
1 parent c1eac83 commit 00de70c

14 files changed

Lines changed: 157 additions & 5 deletions

File tree

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Fix resource references not correctly resolved in apps config section ([#4964](https://github.com/databricks/cli/pull/4964))
1616
* Allow run_as for dashboards with embed_credentials set to false ([#4961](https://github.com/databricks/cli/pull/4961))
1717
* direct: Pass changed fields into update mask for apps instead of wildcard ([#4963](https://github.com/databricks/cli/pull/4963))
18+
* engine/direct: Fix deploy of configurations with dots in maps keys ([#4977](https://github.com/databricks/cli/pull/4977))
1819

1920
### Dependency updates
2021

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
bundle:
2+
name: test-bundle
3+
4+
variables:
5+
AZURE:
6+
type: complex
7+
default:
8+
subscription: test-sub-123
9+
10+
resources:
11+
schemas:
12+
my_schema:
13+
catalog_name: main
14+
name: test-schema
15+
16+
pipelines:
17+
my_pipeline:
18+
name: test-pipeline
19+
libraries:
20+
- file:
21+
path: pipeline.py
22+
configuration:
23+
europris.swipe.egress_streaming_schema: "${resources.schemas.my_schema.catalog_name}.${resources.schemas.my_schema.name}"
24+
europris.azure.subscription: ${var.AZURE.subscription}

acceptance/bundle/deploy/pipeline-config-dots/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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
>>> [CLI] bundle validate
3+
Name: test-bundle
4+
Target: default
5+
Workspace:
6+
User: [USERNAME]
7+
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
8+
9+
Validation OK!
10+
11+
>>> [CLI] bundle deploy
12+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
13+
Deploying resources...
14+
Updating deployment state...
15+
Deployment complete!
16+
17+
>>> [CLI] bundle destroy --auto-approve
18+
The following resources will be deleted:
19+
delete resources.pipelines.my_pipeline
20+
delete resources.schemas.my_schema
21+
22+
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
23+
delete resources.schemas.my_schema
24+
25+
This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the
26+
Streaming Tables (STs) and Materialized Views (MVs) managed by them:
27+
delete resources.pipelines.my_pipeline
28+
29+
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
30+
31+
Deleting files...
32+
Destroy complete!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pass
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
trace $CLI bundle validate
2+
3+
cleanup() {
4+
trace $CLI bundle destroy --auto-approve
5+
}
6+
trap cleanup EXIT
7+
8+
trace $CLI bundle deploy
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
bundle:
2+
name: test-bundle-$UNIQUE_NAME
3+
4+
variables:
5+
AZURE:
6+
type: complex
7+
default:
8+
subscription: test-sub-123
9+
10+
resources:
11+
schemas:
12+
my_schema:
13+
catalog_name: main
14+
name: test-schema-$UNIQUE_NAME
15+
16+
pipelines:
17+
my_pipeline:
18+
name: test-pipeline-$UNIQUE_NAME
19+
libraries:
20+
- file:
21+
path: pipeline.py
22+
configuration:
23+
europris.swipe.egress_streaming_schema: "${resources.schemas.my_schema.catalog_name}.${resources.schemas.my_schema.name}"
24+
europris.azure.subscription: ${var.AZURE.subscription}

acceptance/bundle/invariant/continue_293/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/invariant/continue_293/test.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ EnvMatrixExclude.no_grant_ref = ["INPUT_CONFIG=schema_grant_ref.yml.tmpl"]
55

66
# Model permissions did not work until 0.297.0 https://github.com/databricks/cli/pull/4941
77
EnvMatrixExclude.no_model_with_permissions = ["INPUT_CONFIG=model_with_permissions.yml.tmpl"]
8+
9+
# Dotted pipeline configuration keys are not supported on v0.293.0
10+
EnvMatrixExclude.no_pipeline_config_dots = ["INPUT_CONFIG=pipeline_config_dots.yml.tmpl"]

acceptance/bundle/invariant/migrate/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)