Skip to content

Commit fa0707d

Browse files
denikIsaac
andcommitted
acceptance: strip custom_max_retention_hours from schemas/update requests
The schema force-send makes the direct engine emit custom_max_retention_hours:0 on every update, which terraform can't; schemas/update runs under both engines, so extend its existing engine-normalizing grep (already drops enable_predictive_optimization) to also drop custom_max_retention_hours. Co-authored-by: Isaac <[email protected]>
1 parent 502697a commit fa0707d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
3030
json.method = "PATCH";
3131
json.path = "/api/2.1/unity-catalog/schemas/main.myschema";
3232
json.body.comment = "COMMENT2";
33-
json.body.custom_max_retention_hours = 0;
3433
schemas schema1 id='main.myschema' name='myschema' catalog_name='main' comment='COMMENT2'
3534

3635
=== Restore comment to original value and re-deploy
@@ -46,5 +45,4 @@ Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
4645
json.method = "PATCH";
4746
json.path = "/api/2.1/unity-catalog/schemas/main.myschema";
4847
json.body.comment = "COMMENT1";
49-
json.body.custom_max_retention_hours = 0;
5048
schemas schema1 id='main.myschema' name='myschema' catalog_name='main' comment='COMMENT1'

‎acceptance/bundle/resources/schemas/update/script‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ trace update_file.py databricks.yml COMMENT1 COMMENT2
88
trace $CLI bundle deploy
99
# Why the first time request match for direct & terraform, the requests from second deploy no longer match:
1010
# Terraform also sends "enable_predictive_optimization": "INHERIT" which is remote value that it stored in the state.
11-
trace print_requests.py //unity | gron.py | grep -v enable_predictive_optimization
11+
trace print_requests.py //unity | gron.py | grep -vE 'enable_predictive_optimization|custom_max_retention_hours'
1212
read_state.py schemas schema1 id name catalog_name comment
1313

1414
title "Restore comment to original value and re-deploy"
1515
trace update_file.py databricks.yml COMMENT2 COMMENT1
1616
trace $CLI bundle deploy
17-
trace print_requests.py //unity | gron.py | grep -v enable_predictive_optimization
17+
trace print_requests.py //unity | gron.py | grep -vE 'enable_predictive_optimization|custom_max_retention_hours'
1818
read_state.py schemas schema1 id name catalog_name comment
1919

2020
rm -f "$OUT_REQUESTS"

0 commit comments

Comments
 (0)