Skip to content

Commit

Permalink
Readd exp_path for config deprecation warnings (#7536)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9c7e01d)
  • Loading branch information
jtcohen6 authored and github-actions[bot] committed May 30, 2023
1 parent de9ee6a commit 75a3771
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
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

0 comments on commit 75a3771

Please sign in to comment.