Skip to content

Commit

Permalink
Switch require_explicit_package_overrides_for_builtin_materialization…
Browse files Browse the repository at this point in the history
…s default to True
  • Loading branch information
jtcohen6 committed Apr 29, 2024
1 parent bd2440d commit 8f028fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/dbt/contracts/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 4 additions & 10 deletions tests/functional/materializations/test_custom_materialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8f028fe

Please sign in to comment.