Search before asking
What Happened
When applying sqlfluff fix the auto fix for ST04 (flattening of CASE ... WHEN statements) removes all comments.
Expected Behaviour
Not 100% clear. Either
- Comments should be preserved relative to the start of
CASE
- Auto fix should not be possible if comments are present (because the comments may not make complete sense at new location)
Observed Behaviour
SELECT
CASE
WHEN FALSE
THEN "value1"
WHEN TRUE
THEN "value2"
END
FROM table
How to reproduce
Run sqlfluff fix on
SELECT
CASE
WHEN FALSE
THEN "value1" -- a comment
ELSE
CASE
-- another comment
WHEN TRUE
THEN "value2"
END
END
FROM table
Dialect
BigQuery (put probably applies to all)
Version
2.1.0
Configuration
default
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
Search before asking
What Happened
When applying
sqlfluff fixthe auto fix forST04(flattening ofCASE ... WHENstatements) removes all comments.Expected Behaviour
Not 100% clear. Either
CASEObserved Behaviour
How to reproduce
Run
sqlfluff fixonDialect
BigQuery (put probably applies to all)
Version
2.1.0Configuration
default
Are you willing to work on and submit a PR to address the issue?
Code of Conduct