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 and MichelleArk committed Dec 4, 2024
1 parent a4b3085 commit 88406b4
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()

Check warning on line 630 in core/dbt/parser/manifest.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/manifest.py#L630

Added line #L630 was not covered by tests

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:

Check warning on line 634 in core/dbt/parser/manifest.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/manifest.py#L634

Added line #L634 was not covered by tests
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 88406b4

Please sign in to comment.