Incorrect CSV for `decimal_comma` and `float_scientific`
Author: kdn36Created Sep 29, 2026Updated Sep 30, 2026
Labelsbuggood first issueacceptedA-dtype-decimalP-mediumA-io-csv
Checks
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of Polars.
Reproducible example
import polars as pl
df = pl.DataFrame({"a": [1.5, 2.5, 3.5]})
out = df.write_csv(float_scientific=True, decimal_comma=True, separator=";")
# actual 'a\n1,5e0\n1,5e02,5e0\n1,5e02,5e03,5e0\n'
# expected 'a\n1,5e0\n2,5e0\n3,5e0\n'Log output
actual : 'a\n1,5e0\n1,5e02,5e0\n1,5e02,5e03,5e0\n'
expected: 'a\n1,5e0\n2,5e0\n3,5e0\n'
[{'a': '1,5e0'}, {'a': '1,5e02,5e0'}, {'a': '1,5e02,5e03,5e0'}]
Traceback (most recent call last):
File "/home/koen/my-polars/fuzz/findings/mre_io_csv_float_scientific_decimal_comma.py", line 19, in <module>
assert out == "a\n1,5e0\n2,5e0\n3,5e0\n", "SILENT WRITER CORRUPTION"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: SILENT WRITER CORRUPTION
also,
$ cat tt.csv
a
1,5e0
1,5e02,5e0
1,5e02,5e03,5e0Issue description
Incorrect formatting.
Expected behavior
See repro.
Installed versions
Reproduces on 1.44.2 and latest main.
Source: pola-rs/polars