From 2183ca57ec1b686fe1248f0806aaba5d0a207568 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 26 Jun 2026 15:47:31 +0200 Subject: [PATCH 1/4] acc: drop effective_predictive_optimization_flag from schema plan golden files The test metastore's predictive optimization flag is backend-controlled and not relevant to CLI behavior. Removing it prevents spurious failures when the metastore setting changes. Co-authored-by: Isaac --- .../grants/schemas/duplicate_principals/out.plan.direct.json | 5 ----- .../schemas/out_of_band_principal/out.plan.direct.json | 5 ----- .../schemas/out_of_band_principal/out.plan2.direct.json | 5 ----- 3 files changed, 15 deletions(-) diff --git a/acceptance/bundle/resources/grants/schemas/duplicate_principals/out.plan.direct.json b/acceptance/bundle/resources/grants/schemas/duplicate_principals/out.plan.direct.json index 2030bf1fb6f..a607cdae144 100644 --- a/acceptance/bundle/resources/grants/schemas/duplicate_principals/out.plan.direct.json +++ b/acceptance/bundle/resources/grants/schemas/duplicate_principals/out.plan.direct.json @@ -12,11 +12,6 @@ "catalog_type": "MANAGED_CATALOG", "created_at": [UNIX_TIME_MILLIS][0], "created_by": "[USERNAME]", - "effective_predictive_optimization_flag": { - "inherited_from_name": "[METASTORE_NAME]", - "inherited_from_type": "METASTORE", - "value": "DISABLE" - }, "enable_predictive_optimization": "INHERIT", "full_name": "main.schema_dup_grants_[UNIQUE_NAME]", "metastore_id": "[UUID]", diff --git a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan.direct.json b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan.direct.json index 6949f43812e..575cb2d62c7 100644 --- a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan.direct.json +++ b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan.direct.json @@ -12,11 +12,6 @@ "catalog_type": "MANAGED_CATALOG", "created_at": [UNIX_TIME_MILLIS][0], "created_by": "[USERNAME]", - "effective_predictive_optimization_flag": { - "inherited_from_name": "[METASTORE_NAME]", - "inherited_from_type": "METASTORE", - "value": "DISABLE" - }, "enable_predictive_optimization": "INHERIT", "full_name": "main.schema_out_of_band_principal_[UNIQUE_NAME]", "metastore_id": "[UUID]", diff --git a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan2.direct.json b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan2.direct.json index 563771de5d9..087d95f1d32 100644 --- a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan2.direct.json +++ b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/out.plan2.direct.json @@ -12,11 +12,6 @@ "catalog_type": "MANAGED_CATALOG", "created_at": [UNIX_TIME_MILLIS][0], "created_by": "[USERNAME]", - "effective_predictive_optimization_flag": { - "inherited_from_name": "[METASTORE_NAME]", - "inherited_from_type": "METASTORE", - "value": "DISABLE" - }, "enable_predictive_optimization": "INHERIT", "full_name": "main.schema_out_of_band_principal_[UNIQUE_NAME]", "metastore_id": "[UUID]", From 62f5276669b71cb3f47c8af2566ad90f10d3ee6c Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 26 Jun 2026 15:51:48 +0200 Subject: [PATCH 2/4] acc: strip effective_predictive_optimization_flag in grants schema scripts The plan json is generated live by 'bundle plan', so the metastore-inherited field must be stripped in the script (like sibling change_privilege/catalogs/ volumes tests already do), not just removed from the golden file. Co-authored-by: Isaac --- .../resources/grants/schemas/duplicate_principals/script | 3 +++ .../resources/grants/schemas/out_of_band_principal/script | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/acceptance/bundle/resources/grants/schemas/duplicate_principals/script b/acceptance/bundle/resources/grants/schemas/duplicate_principals/script index af3ef3b1376..479b54f81e2 100644 --- a/acceptance/bundle/resources/grants/schemas/duplicate_principals/script +++ b/acceptance/bundle/resources/grants/schemas/duplicate_principals/script @@ -10,3 +10,6 @@ trap cleanup EXIT trace $CLI bundle deploy print_requests.py --get //permissions --keep > out.requests.$DATABRICKS_BUNDLE_ENGINE.txt trace $CLI bundle plan -o json > out.plan.$DATABRICKS_BUNDLE_ENGINE.json +tmp=$(mktemp) +# effective_predictive_optimization_flag is inherited from the metastore and backend-controlled; drop it so the test does not depend on metastore settings. +jq 'del(.plan["resources.schemas.apps_schema"].remote_state.effective_predictive_optimization_flag)' out.plan.$DATABRICKS_BUNDLE_ENGINE.json > "$tmp" && mv "$tmp" out.plan.$DATABRICKS_BUNDLE_ENGINE.json diff --git a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/script b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/script index 35622673035..4ae7b3e6843 100644 --- a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/script +++ b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/script @@ -16,6 +16,9 @@ trace $CLI bundle plan -o json > out.plan.$DATABRICKS_BUNDLE_ENGINE.json # remote_state.__embed__ order is non-deterministic; extract and sort separately into per-engine file jq '.plan["resources.schemas.grants_schema.grants"].remote_state.__embed__' out.plan.$DATABRICKS_BUNDLE_ENGINE.json | gron.py --noindex | sort_lines.py --repl > out.embed.$DATABRICKS_BUNDLE_ENGINE.txt tmp=$(mktemp) -jq 'del(.plan["resources.schemas.grants_schema.grants"].remote_state.__embed__)' out.plan.$DATABRICKS_BUNDLE_ENGINE.json > "$tmp" && mv "$tmp" out.plan.$DATABRICKS_BUNDLE_ENGINE.json +# effective_predictive_optimization_flag is inherited from the metastore and backend-controlled; drop it so the test does not depend on metastore settings. +jq 'del(.plan["resources.schemas.grants_schema.grants"].remote_state.__embed__, .plan["resources.schemas.grants_schema"].remote_state.effective_predictive_optimization_flag)' out.plan.$DATABRICKS_BUNDLE_ENGINE.json > "$tmp" && mv "$tmp" out.plan.$DATABRICKS_BUNDLE_ENGINE.json trace $CLI bundle deploy trace $CLI bundle plan -o json > out.plan2.$DATABRICKS_BUNDLE_ENGINE.json +tmp=$(mktemp) +jq 'del(.plan["resources.schemas.grants_schema"].remote_state.effective_predictive_optimization_flag)' out.plan2.$DATABRICKS_BUNDLE_ENGINE.json > "$tmp" && mv "$tmp" out.plan2.$DATABRICKS_BUNDLE_ENGINE.json From d7d547c8862dc57395378252db6ac626ec029aba Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Sat, 27 Jun 2026 11:44:58 +0200 Subject: [PATCH 3/4] acc: align predictive optimization flag with metastore flip to ENABLE The test metastore now inherits ENABLE for predictive optimization. Flip the testserver to match (keeping local and cloud goldens consistent) and update the one local golden that displays the value (schemas/recreate). Strip the flag from the cloud-only artifact_path_with_volume test so it no longer depends on the backend-controlled metastore setting. Co-authored-by: Isaac --- .../artifacts/artifact_path_with_volume/common_script.sh | 3 ++- .../artifact_path_with_volume/volume_doesnot_exist/output.txt | 4 ---- .../artifact_path_with_volume/volume_not_deployed/output.txt | 4 ---- acceptance/bundle/resources/schemas/recreate/output.txt | 2 +- libs/testserver/schemas.go | 4 ++-- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/acceptance/bundle/artifacts/artifact_path_with_volume/common_script.sh b/acceptance/bundle/artifacts/artifact_path_with_volume/common_script.sh index c9d31b25da3..6eb6f1a868e 100644 --- a/acceptance/bundle/artifacts/artifact_path_with_volume/common_script.sh +++ b/acceptance/bundle/artifacts/artifact_path_with_volume/common_script.sh @@ -1,5 +1,6 @@ export SCHEMA_NAME=schema-$UNIQUE_NAME trace envsubst < $TESTDIR/../databricks.yml.tmpl > databricks.yml trap "trace '$CLI' schemas delete main.$SCHEMA_NAME" EXIT -trace $CLI schemas create $SCHEMA_NAME main | jq 'del(.effective_predictive_optimization_flag.inherited_from_name)' +# effective_predictive_optimization_flag is inherited from the metastore and backend-controlled; drop it so the test does not depend on metastore settings. +trace $CLI schemas create $SCHEMA_NAME main | jq 'del(.effective_predictive_optimization_flag)' trace musterr $CLI bundle deploy diff --git a/acceptance/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/output.txt b/acceptance/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/output.txt index 7307bcb0a87..369460360da 100644 --- a/acceptance/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/output.txt +++ b/acceptance/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/output.txt @@ -8,10 +8,6 @@ "catalog_type": "MANAGED_CATALOG", "created_at": [UNIX_TIME_MILLIS][0], "created_by": "[USERNAME]", - "effective_predictive_optimization_flag": { - "inherited_from_type": "METASTORE", - "value": "DISABLE" - }, "enable_predictive_optimization": "INHERIT", "full_name": "main.schema-[UNIQUE_NAME]", "metastore_id": "[UUID]", diff --git a/acceptance/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/output.txt b/acceptance/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/output.txt index d8cae4e8af7..d5788b0b3c5 100644 --- a/acceptance/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/output.txt +++ b/acceptance/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/output.txt @@ -8,10 +8,6 @@ "catalog_type": "MANAGED_CATALOG", "created_at": [UNIX_TIME_MILLIS][0], "created_by": "[USERNAME]", - "effective_predictive_optimization_flag": { - "inherited_from_type": "METASTORE", - "value": "DISABLE" - }, "enable_predictive_optimization": "INHERIT", "full_name": "main.schema-[UNIQUE_NAME]", "metastore_id": "[UUID]", diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index 1b1e3a3f9cd..12fedd022e4 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -76,7 +76,7 @@ Error: Resource catalog.SchemaInfo not found: main.myschema "effective_predictive_optimization_flag": { "inherited_from_name": "[METASTORE_NAME]", "inherited_from_type": "METASTORE", - "value": "DISABLE" + "value": "ENABLE" }, "enable_predictive_optimization": "INHERIT", "full_name": "newmain.myschema", diff --git a/libs/testserver/schemas.go b/libs/testserver/schemas.go index f3f7ecd2680..e1807ed8b62 100644 --- a/libs/testserver/schemas.go +++ b/libs/testserver/schemas.go @@ -42,9 +42,9 @@ func (s *FakeWorkspace) SchemasCreate(req Request) Response { schema.EffectivePredictiveOptimizationFlag = &catalog.EffectivePredictiveOptimizationFlag{ InheritedFromName: testMetastoreName, InheritedFromType: catalog.EffectivePredictiveOptimizationFlagInheritedFromType("METASTORE"), - // Mirror the real test metastore, which inherits DISABLE, so a single + // Mirror the real test metastore, which inherits ENABLE, so a single // golden stays valid for both local and cloud runs. - Value: catalog.EnablePredictiveOptimizationDisable, + Value: catalog.EnablePredictiveOptimizationEnable, } schema.EnablePredictiveOptimization = catalog.EnablePredictiveOptimizationInherit schema.MetastoreId = TestMetastore.MetastoreId From e218a3b3e4b2c5891dcb6ee16027ed83a648992f Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Sat, 27 Jun 2026 21:03:37 +0200 Subject: [PATCH 4/4] acc: update schema unit test for testserver ENABLE flip TestResourceSchema_DoUpdate_WithUnsupportedForceSendFields asserts against the testserver fake, which now returns ENABLE for the metastore-inherited flag. Co-authored-by: Isaac --- bundle/direct/dresources/schema_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/direct/dresources/schema_test.go b/bundle/direct/dresources/schema_test.go index 8d58adaa3cb..d013610e052 100644 --- a/bundle/direct/dresources/schema_test.go +++ b/bundle/direct/dresources/schema_test.go @@ -58,7 +58,7 @@ func TestResourceSchema_DoUpdate_WithUnsupportedForceSendFields(t *testing.T) { "effective_predictive_optimization_flag": { "inherited_from_name": "deco-uc-prod-isolated-aws-us-east-1", "inherited_from_type": "METASTORE", - "value": "DISABLE" + "value": "ENABLE" }, "enable_predictive_optimization": "INHERIT", "properties": {"key": "updated_value"},