8000 `allow_implicit_indents` doesn't support `QUALIFY` · Issue #6325 · sqlfluff/sqlfluff · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

allow_implicit_indents doesn't support QUALIFY #6325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 3 tasks
mroy-seedbox opened this issue Oct 9, 2024 · 2 comments · Fixed by #6438
Closed
2 of 3 tasks

allow_implicit_indents doesn't support QUALIFY #6325

mroy-seedbox opened this issue Oct 9, 2024 · 2 comments · Fixed by #6438
Labels
bug Something isn't working

Comments

@mroy-seedbox
Copy link
Contributor
mroy-seedbox commented Oct 9, 2024

Search before asking

  • I searched the issues and found no similar issues.

What Happened

For the following query, LT02 is triggered as expected: Expected line break and indent of 2 spaces before '1'. sqlfluff(LT02: layout.indent)

SELECT 123
WHERE 1 = 1
  AND 2 = 2
QUALIFY 1 = 1
  AND 2 = 2;

But when setting allow_implicit_indents = True, the issue disappears for the WHERE, but remains for the QUALIFY:

image

Expected Behaviour

No issue is detected.

Observed Behaviour

An issue is detected.

How to reproduce

See above (plus the minimal configurations below).

Dialect

Snowflake (but should apply to any dialect).

Version

==== sqlfluff ====
sqlfluff:                3.2.2 python:                 3.10.7
implementation:        cpython verbosity:                   1
dialect:             snowflake templater:               jinja
rules:                                all

Configuration

[sqlfluff]
templater = jinja
dialect = snowflake

[sqlfluff:indentation]
tab_space_size = 2
allow_implicit_indents = True

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

I'm not sure where to start. I think this one might be beyond me.

Code of Conduct

@mroy-seedbox mroy-seedbox added the bug Something isn't working label Oct 9, 2024
@mroy-seedbox
Copy link
Contributor Author

The same issue also happens with functions, like IFF():

IFF(condition,
  column1,
  column2
)

Which must currently be updated to:

IFF(
  condition,
  column1,
  column2
)

@mroy-seedbox
Copy link
Contributor Author
mroy-seedbox commented Oct 20, 2024

The same issue also happens when using FROM TABLE(...) in Snowflake:
image

Or:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0