From 8f028fea8139bfeeb73ff1d3a507273a0e9f2f70 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Mon, 29 Apr 2024 14:10:37 +0200 Subject: [PATCH] Switch require_explicit_package_overrides_for_builtin_materializations default to True --- core/dbt/contracts/project.py | 2 +- .../test_custom_materialization.py | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/dbt/contracts/project.py b/core/dbt/contracts/project.py index d931c3371cb..c2090eb4d10 100644 --- a/core/dbt/contracts/project.py +++ b/core/dbt/contracts/project.py @@ -331,7 +331,7 @@ class ProjectFlags(ExtensibleDbtClassMixin): write_json: Optional[bool] = None # legacy behaviors - require_explicit_package_overrides_for_builtin_materializations: bool = False + require_explicit_package_overrides_for_builtin_materializations: bool = True require_resource_names_without_spaces: bool = False source_freshness_run_project_hooks: bool = False diff --git a/tests/functional/materializations/test_custom_materialization.py b/tests/functional/materializations/test_custom_materialization.py index 2c3ec4e74c2..0a100021db2 100644 --- a/tests/functional/materializations/test_custom_materialization.py +++ b/tests/functional/materializations/test_custom_materialization.py @@ -37,11 +37,8 @@ def packages(self): def test_adapter_dependency(self, project, override_view_adapter_dep, set_up_deprecations): run_dbt(["deps"]) - # this should error because the override is buggy - run_dbt(["run"], expect_pass=False) - - # overriding a built-in materialization scoped to adapter from package is deprecated - assert deprecations.active_deprecations == {"package-materialization-override"} + # this should pass because implicit overrides are now deprecated (= disabled by default) + run_dbt(["run"]) class TestOverrideAdapterDependencyDeprecated: @@ -101,11 +98,8 @@ def packages(self): def test_default_dependency(self, project, override_view_default_dep, set_up_deprecations): run_dbt(["deps"]) - # this should error because the override is buggy - run_dbt(["run"], expect_pass=False) - - # overriding a built-in materialization from package is deprecated - assert deprecations.active_deprecations == {"package-materialization-override"} + # this should pass because implicit overrides are now deprecated (= disabled by default) + run_dbt(["run"]) class TestOverrideDefaultDependencyDeprecated: