Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access DEBUG flag through get_flags() #11069

Merged
merged 3 commits into from
Dec 4, 2024
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-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 @@
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:

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 @@

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
Loading