prql
prql copied to clipboard
Playground does not display float/decimal results correctly
What happened?
Using the public Playground (version 0.12.2), the Playground displays incorrect results for the round function. It seems to be missing the decimal points in the output.
The generated SQL is correct, and pasting that SQL into SQLite shows the expected results.
PRQL input
from [ { a=1 } ]
select {
math.round 1 1.23,
math.round 1 4.56
}
SQL output
WITH table_0 AS (
SELECT
1 AS a
)
SELECT
ROUND(1.23, 1),
ROUND(4.56, 1)
FROM
table_0
-- Generated by PRQL compiler version:0.12.2 (https://prql-lang.org)
Expected SQL output
==== EXPECTED ====
ROUND(1.23, 1) ROUND(4.56, 1)
1.2 4.6
==== ACTUAL ====
round(1.23, 1) round(4.56, 1)
12 46 <-- Note the lack of decimal points
MVCE confirmation
- [ ] Minimal example
- [ ] New issue
Anything else?
No response
This doesn't require math.round, as you can reproduce the missing decimals without it:
from [ { a=1.23 } ]
derive { b=4.56 }
When you select the "Query Results" tab and click "Copy to clipboard" you get this JSON:
[
{"a": 123, "b": 456}
]
So the playground is just misbehaving when it comes to decimals.