tconbeer / sqlfmt

sqlfmt formats your dbt SQL files so you don't have to
https://sqlfmt.com
Apache License 2.0
417 stars 18 forks source link

Variant Expressions get extra space #637

Open aersam opened 1 month ago

aersam commented 1 month ago

Describe the bug

An Databricks Variant expression such as select e.col:['attr_ID']::string as id gets an extra space: select e.col: ['attr_ID']::string as id

To Reproduce

import sqlfmt.api as sqlfmt

sql = """
        select e.col:['attr_ID']::string as id
        from expl e"""

print(sqlfmt.format_string(sql, sqlfmt.Mode()))

Expected behavior Should not add that space :)

Actual behavior Provide any output generated by sqlfmt here. If this is a formatting issue, include the code generated by sqlfmt.

Additional context What is the output of sqlfmt --version? sqlfmt, version 0.23.2

tconbeer commented 1 month ago

Thanks for the report!