mattaubury opened a new issue, #37903: URL: https://github.com/apache/arrow/issues/37903
### Describe the bug, including details regarding any error messages, version, and platform. (Tested in pyarrow-13.0.0, Linux x64) `WriteCSV` / `write_csv` can print out a duplicate header (and sometimes other junk) when one or more empty batches makes up a table. Minimal example: ``` >>> import sys >>> import pyarrow as pa >>> import pyarrow.csv as csv >>> t1 = pa.table([pa.array([], pa.int64())], "x") >>> t2 = pa.table([pa.array([1, 2, 3], pa.int64())], "x") >>> csv.write_csv(pa.concat_tables([t1, t2]), sys.stdout.buffer) "x" "x" 1 2 3 ``` I expect to only see a single "x" header. From C++, I've also seen WriteCSV output junk before the header (seemingly part of the schema). ### Component(s) C++, Python -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
