Whole file

David-Wobrock/sqlvalidator

The author described this change as Fix 'date' column in if (a bit approx solution, but works for now). It counts as a record because the check below fails on the code as it stood at e6d2d62dd and passes on 46a6a3be7, with nothing else changed between the two runs.

Fix saved2021-02-05
Sharing licenceMIT · LICENSE
Change size+2 2

What the code was meant to do, written into the code itself as a save note

Fix 'date' column in if (a bit approx solution, but works for now)

The change

617617 )
618618 else:
619619 argument_tokens = get_tokens_until_closing_parenthesis(tokens)
620- arguments_can_be_type = (
621- "," in argument_tokens or lower(main_token) == "if"
620+ arguments_can_be_type = can_be_type or any(
621+ lower(t) == "timestamp_trunc" for t in argument_tokens
622622 )
623623 arguments = ExpressionListParser.parse(
624624 iter(argument_tokens), can_be_type=arguments_can_be_type

The check that tells the two apart

failpass·tests/integration/test_formatting.py::test_date_column_in_function_call

Check file tests/integration/test_formatting.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ite6d2d62ddc952a5ebc1b94038c9d50f6757113c7
Broken version dated2021-02-04
Modulesqlvalidator.grammar.lexer
Units changedExpressionParser
Fingerprint604533d3a76a553b
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in David-Wobrock/sqlvalidator