Lint and fix throws exception when having jinja for loop inside set #2835
Labels
bug
Something isn't working
rule bug
A rule is not working as intended, either missing errors or incorrectly highlighting non-errors
templating
Fix or enhance templating capabilities
Search before asking
What Happened
To reproduce the error, create test.template.sql
when running lint i get this error:
This is the rendered query:
And when trying around to make this work i removed the new lines between the selected columns like this:
which renders:
And this will make the linter pass:
Expected Behaviour
My expectations is that the linter and fix should pass.
Observed Behaviour
Right now lint and fix throws exception (see "What Happened" section)
How to reproduce
Mentioned above.
Dialect
snowflake
Version
sqlfluff, version 0.11.0
Configuration
[sqlfluff]
verbose = 1
dialect = snowflake
templater = jinja
exclude_rules = L027,L031,L032,L036,L044,L046,L034,L050
output_line_length = 121
sql_file_exts=.sql
[sqlfluff:rules]
tab_space_size = 4
max_line_length = 250
indent_unit = space
comma_style = trailing
allow_scalar = True
single_table_references = consistent
unquoted_identifiers_policy = aliases
[sqlfluff:rules:L042]
forbid_subquery_in = both
[sqlfluff:rules:L010] # Keywords
capitalisation_policy = upper
[sqlfluff:rules:L014]
extended_capitalisation_policy = lower
[sqlfluff:rules:L030] # function names
extended_capitalisation_policy = upper
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
The text was updated successfully, but these errors were encountered: