You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
This is a bug experienced through SQLfluff when using ManifestLoader.check_for_spaces_in_resource_names().
The way the DEBUG flag is accessed is not consistent with the rest of the codebase and can cause an error if its value is not found.
Expected Behavior
Flags are usually accessed though the get_flags() method which defaults to None.
check_for_spaces_in_resource_names() should comply with this.
Steps To Reproduce
I'm encountering this error when using sqlfluff dbt templater v3.1.0 with dbt 1.8 and above.
Any sqlfluff lint will cause this error.
Relevant log output
File "/application/.venv/bin/sqlfluff", line 8, in<module>sys.exit(cli())
File "/application/.venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/application/.venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/application/.venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/application/.venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/application/.venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/application/.venv/lib/python3.9/site-packages/sqlfluff/cli/commands.py", line 648, in lint
result = lnt.lint_paths(
File "/application/.venv/lib/python3.9/site-packages/sqlfluff/core/linter/linter.py", line 1065, in lint_paths
fori, linted_filein enumerate(runner.run(expanded_paths, fix), start=1):
File "/application/.venv/lib/python3.9/site-packages/sqlfluff/core/linter/runner.py", line 144, in run
forlint_resultin self._map(
File "/Users/thomas/.pyenv/versions/3.9.12/lib/python3.9/multiprocessing/pool.py", line 870, in next
raise value
File "/Users/thomas/.pyenv/versions/3.9.12/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/Users/thomas/.pyenv/versions/3.9.12/lib/python3.9/multiprocessing/pool.py", line 144, in _helper_reraises_exception
raise ex
File "/Users/thomas/.pyenv/versions/3.9.12/lib/python3.9/multiprocessing/pool.py", line 388, in _guarded_task_generation
fori, xin enumerate(iterable):
File "/application/.venv/lib/python3.9/site-packages/sqlfluff/core/linter/runner.py", line 61, in iter_partials
forfname, renderedin self.iter_rendered(fnames):
File "/application/.venv/lib/python3.9/site-packages/sqlfluff/core/linter/runner.py", line 44, in iter_rendered
forfnamein self.linter.templater.sequence_files(
File "/application/.venv/lib/python3.9/site-packages/sqlfluff_templater_dbt/templater.py", line 473, in sequence_files
forkey, nodeinself.dbt_manifest.nodes.items():
File "/Users/thomas/.pyenv/versions/3.9.12/lib/python3.9/functools.py", line 993, in __get__
val = self.func(instance)
File "/application/.venv/lib/python3.9/site-packages/sqlfluff_templater_dbt/templater.py", line 145, in wrapped_method
raise err
File "/application/.venv/lib/python3.9/site-packages/sqlfluff_templater_dbt/templater.py", line 126, in wrapped_method
result = func(*args, **kwargs)
File "/application/.venv/lib/python3.9/site-packages/sqlfluff_templater_dbt/templater.py", line 335, in dbt_manifest
return ManifestLoader.get_full_manifest(self.dbt_config)
File "/application/.venv/lib/python3.9/site-packages/dbt/parser/manifest.py", line 330, in get_full_manifest
manifest = loader.load()
File "/application/.venv/lib/python3.9/site-packages/dbt/parser/manifest.py", line 528, in load
self.check_for_spaces_in_resource_names()
File "/application/.venv/lib/python3.9/site-packages/dbt/parser/manifest.py", line 647, in check_for_spaces_in_resource_names
if improper_resource_names == 0 or self.root_project.args.DEBUG:
AttributeError: 'DbtConfigArgs' object has no attribute 'DEBUG'
Threynaud
changed the title
[Bug] Current DEBUG flag access in the ManifestLoader can cause an AttributeError and is not consitent with the rest of the codebase
[Bug] Current DEBUG flag access in the ManifestLoader can cause an AttributeError and is not consistent with the rest of the codebase
Nov 28, 2024
Is this a new bug in dbt-core?
Current Behavior
This is a bug experienced through SQLfluff when using ManifestLoader.check_for_spaces_in_resource_names().
The way the DEBUG flag is accessed is not consistent with the rest of the codebase and can cause an error if its value is not found.
Expected Behavior
Flags are usually accessed though the get_flags() method which defaults to None.
check_for_spaces_in_resource_names() should comply with this.
Steps To Reproduce
I'm encountering this error when using sqlfluff dbt templater v3.1.0 with dbt 1.8 and above.
Any
sqlfluff lint
will cause this error.Relevant log output
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
This would solve the following SQLFluff issue:
sqlfluff/sqlfluff#5942
The text was updated successfully, but these errors were encountered: