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,