Skip to content

Commit 235672b

Browse files
denikIsaac
andcommitted
acc: drop text plan where the JSON plan already shows it
Also restores the grants/schemas/change_name golden for the in-place rename, which the rebase onto denik/grants-rekey dropped. Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 59538eb commit 235672b

6 files changed

Lines changed: 58 additions & 59 deletions

File tree

‎acceptance/bundle/resources/catalogs/rename/output.txt‎

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,42 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
3939
>>> update_file.py databricks.yml test_catalog_ test_catalog_renamed_
4040

4141
=== UC moves the schema and the volume with the catalog, so the plan re-keys them instead of recreating them
42-
>>> [CLI] bundle plan
43-
update catalogs.catalog1
44-
update schemas.schema1
45-
update volumes.volume1
46-
47-
Plan: 0 to add, 3 to change, 0 to delete, 0 unchanged
48-
4942
>>> [CLI] bundle plan --output json
5043
{
5144
"resources.catalogs.catalog1": {
52-
"name": {
53-
"action": "update_id",
54-
"reason": "id_changes",
55-
"old": "test_catalog_[UNIQUE_NAME]",
56-
"new": "test_catalog_renamed_[UNIQUE_NAME]",
57-
"remote": "test_catalog_[UNIQUE_NAME]"
45+
"action": "update_id",
46+
"changes": {
47+
"name": {
48+
"action": "update_id",
49+
"reason": "id_changes",
50+
"old": "test_catalog_[UNIQUE_NAME]",
51+
"new": "test_catalog_renamed_[UNIQUE_NAME]",
52+
"remote": "test_catalog_[UNIQUE_NAME]"
53+
}
5854
}
5955
},
6056
"resources.schemas.schema1": {
61-
"catalog_name": {
62-
"action": "update_id",
63-
"reason": "parent_renamed",
64-
"old": "test_catalog_[UNIQUE_NAME]",
65-
"new": "test_catalog_renamed_[UNIQUE_NAME]",
66-
"remote": "test_catalog_[UNIQUE_NAME]"
57+
"action": "update_id",
58+
"changes": {
59+
"catalog_name": {
60+
"action": "update_id",
61+
"reason": "parent_renamed",
62+
"old": "test_catalog_[UNIQUE_NAME]",
63+
"new": "test_catalog_renamed_[UNIQUE_NAME]",
64+
"remote": "test_catalog_[UNIQUE_NAME]"
65+
}
6766
}
6867
},
6968
"resources.volumes.volume1": {
70-
"catalog_name": {
71-
"action": "update_id",
72-
"reason": "parent_renamed",
73-
"old": "test_catalog_[UNIQUE_NAME]",
74-
"new": "test_catalog_renamed_[UNIQUE_NAME]",
75-
"remote": "test_catalog_[UNIQUE_NAME]"
69+
"action": "update_id",
70+
"changes": {
71+
"catalog_name": {
72+
"action": "update_id",
73+
"reason": "parent_renamed",
74+
"old": "test_catalog_[UNIQUE_NAME]",
75+
"new": "test_catalog_renamed_[UNIQUE_NAME]",
76+
"remote": "test_catalog_[UNIQUE_NAME]"
77+
}
7678
}
7779
}
7880
}

‎acceptance/bundle/resources/catalogs/rename/script‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ title "Rename the catalog"
2121
trace update_file.py databricks.yml test_catalog_ test_catalog_renamed_
2222

2323
title "UC moves the schema and the volume with the catalog, so the plan re-keys them instead of recreating them"
24-
trace $CLI bundle plan
25-
trace $CLI bundle plan --output json | nostamp | jq '.plan | map_values(.changes | with_entries(select(.value.action != "skip")))'
24+
trace $CLI bundle plan --output json | nostamp | jq '.plan | map_values({action, changes: ((.changes // {}) | with_entries(select(.value.action != "skip")))})'
2625

2726
title "Deploy renames the catalog and updates the schema and the volume at their new paths"
2827
trace $CLI bundle deploy

‎acceptance/bundle/resources/schemas/rename/output.txt‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
2121
>>> update_file.py databricks.yml test-schema- test-schema-renamed-
2222

2323
=== The plan renames the schema in place instead of recreating it
24-
>>> [CLI] bundle plan
25-
update schemas.schema1
26-
27-
Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged
28-
2924
>>> [CLI] bundle plan --output json
3025
{
31-
"name": {
26+
"resources.schemas.schema1": {
3227
"action": "update_id",
33-
"reason": "id_changes",
34-
"old": "test-schema-[UNIQUE_NAME]",
35-
"new": "test-schema-renamed-[UNIQUE_NAME]",
36-
"remote": "test-schema-[UNIQUE_NAME]"
28+
"changes": {
29+
"name": {
30+
"action": "update_id",
31+
"reason": "id_changes",
32+
"old": "test-schema-[UNIQUE_NAME]",
33+
"new": "test-schema-renamed-[UNIQUE_NAME]",
34+
"remote": "test-schema-[UNIQUE_NAME]"
35+
}
36+
}
3737
}
3838
}
3939

‎acceptance/bundle/resources/schemas/rename/script‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ title "Rename the schema"
2020
trace update_file.py databricks.yml test-schema- test-schema-renamed-
2121

2222
title "The plan renames the schema in place instead of recreating it"
23-
trace $CLI bundle plan
24-
trace $CLI bundle plan --output json | nostamp | jq '.plan[].changes' | normalize_uc_payload.py
23+
trace $CLI bundle plan --output json | nostamp | jq '.plan | map_values({action, changes: ((.changes // {}) | with_entries(select(.value.action != "skip")))})'
2524

2625
title "Deploy renames the schema without a deletion prompt"
2726
trace $CLI bundle deploy

‎acceptance/bundle/resources/schemas/rename_with_volume/output.txt‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,30 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
3131
>>> update_file.py databricks.yml test-schema- test-schema-renamed-
3232

3333
=== UC moves the volume with the schema, so the plan re-keys the volume instead of recreating it
34-
>>> [CLI] bundle plan
35-
update schemas.schema1
36-
update volumes.volume1
37-
38-
Plan: 0 to add, 2 to change, 0 to delete, 0 unchanged
39-
4034
>>> [CLI] bundle plan --output json
4135
{
4236
"resources.schemas.schema1": {
43-
"name": {
44-
"action": "update_id",
45-
"reason": "id_changes",
46-
"old": "test-schema-[UNIQUE_NAME]",
47-
"new": "test-schema-renamed-[UNIQUE_NAME]",
48-
"remote": "test-schema-[UNIQUE_NAME]"
37+
"action": "update_id",
38+
"changes": {
39+
"name": {
40+
"action": "update_id",
41+
"reason": "id_changes",
42+
"old": "test-schema-[UNIQUE_NAME]",
43+
"new": "test-schema-renamed-[UNIQUE_NAME]",
44+
"remote": "test-schema-[UNIQUE_NAME]"
45+
}
4946
}
5047
},
5148
"resources.volumes.volume1": {
52-
"schema_name": {
53-
"action": "update_id",
54-
"reason": "parent_renamed",
55-
"old": "test-schema-[UNIQUE_NAME]",
56-
"new": "test-schema-renamed-[UNIQUE_NAME]",
57-
"remote": "test-schema-[UNIQUE_NAME]"
49+
"action": "update_id",
50+
"changes": {
51+
"schema_name": {
52+
"action": "update_id",
53+
"reason": "parent_renamed",
54+
"old": "test-schema-[UNIQUE_NAME]",
55+
"new": "test-schema-renamed-[UNIQUE_NAME]",
56+
"remote": "test-schema-[UNIQUE_NAME]"
57+
}
5858
}
5959
}
6060
}

‎acceptance/bundle/resources/schemas/rename_with_volume/script‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ title "Rename the schema"
2121
trace update_file.py databricks.yml test-schema- test-schema-renamed-
2222

2323
title "UC moves the volume with the schema, so the plan re-keys the volume instead of recreating it"
24-
trace $CLI bundle plan
25-
trace $CLI bundle plan --output json | nostamp | jq '.plan | map_values(.changes | with_entries(select(.value.action != "skip")))'
24+
trace $CLI bundle plan --output json | nostamp | jq '.plan | map_values({action, changes: ((.changes // {}) | with_entries(select(.value.action != "skip")))})'
2625

2726
title "Deploy renames the schema and updates the volume at its new path"
2827
trace $CLI bundle deploy

0 commit comments

Comments
 (0)