pyarrow.csv.WriteOptions quoting_style options do not allow the behavior of python's csv.QUOTE_MINIMAL
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
I've been cutting over some 'I need to give this data to non-techincal users for review' csv file generation in python to pyarrow 16.1 under python 3.10, using streaming to disk via `pyarrow.csv.CSVWriter`. I've noticed some discrepancies in the output format while passing in a `pyarrow.csv.WriteOptions` config to the writer.
With the stdlib's default `csv.QUOTE_MINIMAL`, I would expect the following kind of output:
```
a,b,c
1,foo,"foo,bar"
```
Instead, I am seeing data that looks like this for `pyarrow.csv.WriteOptions(quoting_style='needed')`:
```
"a","b","c"
1,"foo","foo,bar"
```
Which is closer to `csv.QUOTE_NONNUMERIC`. (and, as mentioned in [this issue](https://github.com/apache/arrow/issues/41239), quotes headers, which is true even with `pyarrow.csv.WriteOptions(quoting_style='none')`.
It would be nice to be able to have a 1:1 interface to csv writing that matched the outputs of the native csv writer's [output modes](https://docs.python.org/3.11/library/csv.html#csv.QUOTE_ALL) (noting that there's a few new ones in 3.12). Since `csv.QUOTE_MINIMAL` is the python csv writing default, it would be nice behavior for that to be the default here as well.
### Component(s)
Python
Contributor guide
Assessment
This issue has not been assessed yet.