L003 behavior different between 0.3.6 and 0.4.0a3
See original GitHub issueI have a dbt model that looks like the following:
-- TODO: Update this model
with source_data as (
select * from {{ source('source_name', 'xxx_yyy_zzz') }}
)
select *
from source_data
Using sqlfluff==0.3.6
(with jinja
templater) I get the following lint output:
L: 3 | P: 44 | L001 | Unneccessary trailing whitespace.
Using sqlfluff==0.4.0a3
(with jinja
templater) I get the following lint output:
L: 3 | P: 44 | L001 | Unnecessary trailing whitespace.
L: 4 | P: 1 | L003 | Indentation not consistent with line #3
L: 6 | P: 1 | L003 | Indentation not consistent with line #3
L: 7 | P: 1 | L003 | Line under-indented compared to line #3
When I run sqlfluff fix
on the file with 0.4.0a3
it tries to fix it to be:
-- TODO: Update this model
with source_data as (
select * from {{ source('source_name', 'xxx_yyy_zzz') }}
)
select *
from source_data
This seems like unexpected behavior to me. The fix suggests that sqlfluff may be misunderstanding the indentation levels of my model.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Vol.136, Nos.1-4 (1995) - DTIC
We have found a different temperature dependence in energy transfer processes involving a small number of phonons. 1 YAG:Er, Ho.
Read more >Full text of "DTIC AD0747808: An Analytical Evaluation of the ...
Conclusions resulting from this comparison show that the CTR nas the ... The present analysis describes the behavior of articulated rotors with pitch ......
Read more >vscode-sqlfluff - Coder Social Home
A linter and auto-formatter for SQLFluff, a popular linting tool for SQL and dbt. linter in action. You can run Format Document to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep - found the issue. This should be an easy fix - I’ll make a test case to catch it too.
Some thoughts on the previous comment…
My understanding of
sqlfluff fix
is that it’s doing two things:The latter is the reason
ON
andAND
behave as described.I agree with the original poster; there definitely seems to be a bug here. I don’t have any intuition at this time about the cause.
A few follow-up questions:
.sqlfluff
file?