Skip to content

Commit 9347f54

Browse files
committed
fix resources/schemas/update
1 parent ec1e551 commit 9347f54

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

acceptance/bundle/resources/schemas/update/output.txt

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Deploying resources...
55
Updating deployment state...
66
Deployment complete!
77

8-
>>> print_requests
8+
>>> print_requests.py //unity
99
{
1010
"method": "POST",
1111
"path": "/api/2.1/unity-catalog/schemas",
@@ -26,14 +26,10 @@ Deploying resources...
2626
Updating deployment state...
2727
Deployment complete!
2828

29-
>>> print_requests
30-
{
31-
"method": "PATCH",
32-
"path": "/api/2.1/unity-catalog/schemas/main.myschema",
33-
"body": {
34-
"comment": "COMMENT2"
35-
}
36-
}
29+
>>> print_requests.py //unity
30+
json.method = "PATCH";
31+
json.path = "/api/2.1/unity-catalog/schemas/main.myschema";
32+
json.body.comment = "COMMENT2";
3733
schemas schema1 id='main.myschema' name='myschema' catalog_name='main' comment='COMMENT2'
3834

3935
=== Restore comment to original value and re-deploy
@@ -45,12 +41,8 @@ Deploying resources...
4541
Updating deployment state...
4642
Deployment complete!
4743

48-
>>> print_requests
49-
{
50-
"method": "PATCH",
51-
"path": "/api/2.1/unity-catalog/schemas/main.myschema",
52-
"body": {
53-
"comment": "COMMENT1"
54-
}
55-
}
44+
>>> print_requests.py //unity
45+
json.method = "PATCH";
46+
json.path = "/api/2.1/unity-catalog/schemas/main.myschema";
47+
json.body.comment = "COMMENT1";
5648
schemas schema1 id='main.myschema' name='myschema' catalog_name='main' comment='COMMENT1'
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
echo "*" > .gitignore
22
trace $CLI bundle deploy
33

4-
print_requests() {
5-
jq 'select(.method != "GET" and (.path | contains("/unity")))' < out.requests.txt
6-
rm out.requests.txt
7-
}
8-
9-
trace print_requests
4+
trace print_requests.py //unity
105
read_state.py schemas schema1 id name catalog_name comment
116

127
title "Update comment and re-deploy"
138
trace update_file.py databricks.yml COMMENT1 COMMENT2
149
trace $CLI bundle deploy
15-
trace print_requests
10+
# Why the first time request match for direct & terraform, the requests from second deploy no longer match:
11+
# Terraform also sends "enable_predictive_optimization": "INHERIT" which is remote value that it stored in the state.
12+
trace print_requests.py //unity | gron.py | grep -v enable_predictive_optimization
1613
read_state.py schemas schema1 id name catalog_name comment
1714

1815
title "Restore comment to original value and re-deploy"
1916
trace update_file.py databricks.yml COMMENT2 COMMENT1
2017
trace $CLI bundle deploy
21-
trace print_requests
18+
trace print_requests.py //unity | gron.py | grep -v enable_predictive_optimization
2219
read_state.py schemas schema1 id name catalog_name comment
20+
21+
rm -f out.requests.txt

0 commit comments

Comments
 (0)