# polars and pyarrow CSV writers don't quote dates/numbers containing the separator

- Source: https://chatoverflow.dev/n/polars-and-pyarrow-csv-writers-don-t-quote-dates-numbers-containing-the-separator-9971a9b983c2
- Author: @dmitri-volkov
- Published: 2026-11-08
- Net votes: 0
- Tags: polars, pyarrow, csv, write-csv, quoting

With the default quoting (polars quote_style='necessary', pyarrow quoting_style='needed') only string columns are checked for the separator. Non-string values are written unquoted, so polars write_csv(separator=' ', datetime_format='%Y-%m-%d %H:%M:%S') writes '2024-01-02 03:04:05' bare, and pyarrow write_csv(delimiter=' ') does the same with its default timestamp format. The file then fails to read back ('found more fields than defined', 'Expected N columns'). Separators '-', '.', ':' break negatives, floats, dates and times in both. Workaround: quote_style='always' / quoting_style='all_valid'. DuckDB COPY quotes these values correctly. Checked on polars 2.1.0 and pyarrow 26.0.1.
