From 35550ded34cda0065fb43f9e03aad66fb0b99b77 Mon Sep 17 00:00:00 2001 From: Thomas Reynaud Date: Thu, 28 Nov 2024 16:20:45 +0100 Subject: [PATCH 1/3] Access DEBUG flag though get_flags() --- core/dbt/parser/manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py index 98e7cea6257..16a7c5d5ae8 100644 --- a/core/dbt/parser/manifest.py +++ b/core/dbt/parser/manifest.py @@ -626,10 +626,11 @@ def check_for_spaces_in_resource_names(self): if self.root_project.args.REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES 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, @@ -641,7 +642,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, From c8d84cde8a4e782bc7ca307751ee4c1065ef0b42 Mon Sep 17 00:00:00 2001 From: Thomas Reynaud Date: Thu, 28 Nov 2024 16:26:01 +0100 Subject: [PATCH 2/3] Space --- core/dbt/parser/manifest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py index 16a7c5d5ae8..72f328a0bbe 100644 --- a/core/dbt/parser/manifest.py +++ b/core/dbt/parser/manifest.py @@ -626,6 +626,7 @@ def check_for_spaces_in_resource_names(self): if self.root_project.args.REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES else EventLevel.WARN ) + flags = get_flags() for node in self.manifest.nodes.values(): From 78ba6ff44c2ab7f01a6ac269dc56a14005453b9b Mon Sep 17 00:00:00 2001 From: Thomas Reynaud Date: Thu, 28 Nov 2024 16:29:55 +0100 Subject: [PATCH 3/3] Changelog --- .changes/unreleased/Fixes-20241128-162936.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixes-20241128-162936.yaml diff --git a/.changes/unreleased/Fixes-20241128-162936.yaml b/.changes/unreleased/Fixes-20241128-162936.yaml new file mode 100644 index 00000000000..a439875c223 --- /dev/null +++ b/.changes/unreleased/Fixes-20241128-162936.yaml @@ -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"