Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230506-180900.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix warning messages for deprecated dbt_project.yml configs
time: 2023-05-06T18:09:00.361961+02:00
custom:
Author: jtcohen6
Issue: "7424"
8 changes: 4 additions & 4 deletions core/dbt/config/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ def check_config_path(
# this field is no longer supported, but many projects may specify it with the default value
# if so, let's only raise this deprecation warning if they set a custom value
if not default_value or project_dict[deprecated_path] != default_value:
deprecations.warn(
f"project-config-{deprecated_path}",
deprecated_path=deprecated_path,
)
kwargs = {"deprecated_path": deprecated_path}
if expected_path:
kwargs.update({"exp_path": expected_path})
deprecations.warn(f"project-config-{deprecated_path}", **kwargs)

def create_project(self, rendered: RenderComponents) -> "Project":
unrendered = RenderComponents(
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/events/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def code(self):

def message(self):
description = (
f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`."
f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`. "
"Please update your `dbt_project.yml` configuration to reflect this change."
)
return line_wrap_message(warning_tag(f"Deprecated functionality\n\n{description}"))
Expand All @@ -292,7 +292,7 @@ def code(self):

def message(self):
description = (
f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`."
f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`. "
"Please update your `dbt_project.yml` configuration to reflect this change."
)
return line_wrap_message(warning_tag(f"Deprecated functionality\n\n{description}"))
Expand Down