Open ghost opened 4 years ago
Previously it was fine, with the latest version i'm getting same warning for similar queries from all over the code base.
There is another query on which it is throwing Q449 token FROM should be aligned to the right of the river
SELECT col1
FROM table1
WHERE NOT EXISTS(SELECT col2
FROM table2
WHERE condtion)
Could that be due to this EXISTS statement?
Hmm, I'm not sure here - it could be. Could you confirm which version it worked in, and which version you are using now?
Previously 0.2.0 and now 0.4.0. The case is with every exists query of the same nature.
I think it is the exists (and also this https://github.com/pgjones/flake8-sql/commit/d1a1000e870db0c3fd88cf5e5c7a62c33aad51d8) - as the exists isn't being recognized as a function.
So is this going to be fixed soon? Or if you can point me i might be able to send a fix.
Very happy for you to send a fix, at the moment I can only point to d1a1000.
I had a look at the function you pointed out, seems like it is working fine (had it debugged). I think the problem is here on this line or below it: https://github.com/pgjones/flake8-sql/blob/ba92c22c2b5a94605b7be10f223d1c1e5d3d706a/flake8_sql/linter.py#L150
Debugged this one as well, the values (token col, depth, and previous root values) seems fine to me ( i might not be correct).
Could there be any issue with this condition? https://github.com/pgjones/flake8-sql/blob/ba92c22c2b5a94605b7be10f223d1c1e5d3d706a/flake8_sql/linter.py#L152
Values (debugged):
token: FROM token.col: 27 token.depth: 1 previous_root: SELECT previous_root.col: 25 previous_root len+1: 7
By adding the root_keyword condition is not working (failing other scenarios), can you help me out a bit here?
Hey @pgjones I have this query
and getting this Q449 warning: Q449 token FROM should be aligned to the right of the river
Is there any problem in my query formatting or i am not able to understand it or the lib is confused? Can you please point it out? I am using the latest version.
I'll be suppressing it for now until i get a replay from you. Thanks