tconbeer / sqlfmt

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

sqlfmt introduces space in scientific notation #534

Closed aersam closed 7 months ago

aersam commented 7 months ago

Describe the bug Sqlfmt turns this:

select 1.0e-10 as test

into this:

select 1.0e -10 as test

the first one is valid spark sql, the second one is not.

Expected behavior The scientific notation should remain as is.

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

sqlfmt, version 0.21.0

tconbeer commented 7 months ago

I can't reproduce, and we have a test for this: https://github.com/tconbeer/sqlfmt/blob/main/tests/data/unformatted/125_numeric_constants.sql

Is it possible you have the wrong sqlfmt package installed?

aersam commented 7 months ago

You were completely right. We had two formatters in place :( First VS Code formatted the files and then sqlfmt. Vs Code messed it up. I disabled it and we only use sqlfmt, having two formatters is really pointless