-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
See this example snippet:
>>> format_sql.format_sql('''select a.a from aaa a where ((a.b+1) = 2);''')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/koerner/miniconda3/envs/tests-sql/lib/python3.6/site-packages/format_sql/shortcuts.py", line 20, in format_sql
parsed = list(parse(tokens))
File "/home/koerner/miniconda3/envs/tests-sql/lib/python3.6/site-packages/format_sql/parser.py", line 762, in parse
for statement, unused_count in _parse(toks):
File "/home/koerner/miniconda3/envs/tests-sql/lib/python3.6/site-packages/format_sql/parser.py", line 756, in _parse
statement, count = func(toks)
File "/home/koerner/miniconda3/envs/tests-sql/lib/python3.6/site-packages/format_sql/parser.py", line 596, in _parse_where
conditions, j = _parse_conditions(toks[1:])
File "/home/koerner/miniconda3/envs/tests-sql/lib/python3.6/site-packages/format_sql/parser.py", line 701, in _parse_conditions
raise InvalidCondition()
format_sql.parser.InvalidConditionIt seems that all (most?) queries with the following conditions <table>.<column> + 1 = <some other value> fail to parse:
select a.a from aaa a where a.b+1 = 2;Metadata
Metadata
Assignees
Labels
No labels