Skip to content

Commit

Permalink
Access DEBUG flag through get_flags() (#11069)
Browse files Browse the repository at this point in the history
  • Loading branch information
Threynaud authored Dec 4, 2024
1 parent 1b7d9b5 commit fdfe03d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20241128-162936.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Access DBUG flag more consistently with the rest of the codebase in ManifestLoader
time: 2024-11-28T16:29:36.236729+01:00
custom:
Author: Threynaud
Issue: "11068"
5 changes: 3 additions & 2 deletions core/dbt/parser/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,11 @@ def check_for_spaces_in_resource_names(self):
else EventLevel.WARN
)

flags = get_flags()

for node in self.manifest.nodes.values():
if " " in node.name:
if improper_resource_names == 0 or self.root_project.args.DEBUG:
if improper_resource_names == 0 or flags.DEBUG:
fire_event(
SpacesInResourceNameDeprecation(
unique_id=node.unique_id,
Expand All @@ -641,7 +643,6 @@ def check_for_spaces_in_resource_names(self):

if improper_resource_names > 0:
if level == EventLevel.WARN:
flags = get_flags()
dbt.deprecations.warn(
"resource-names-with-spaces",
count_invalid_names=improper_resource_names,
Expand Down

0 comments on commit fdfe03d

Please sign in to comment.