egolearner commented on code in PR #49858:
URL: https://github.com/apache/arrow/pull/49858#discussion_r3252835831


##########
python/pyarrow/tests/test_csv.py:
##########
@@ -2149,3 +2149,49 @@ def 
test_write_csv_empty_batch_should_not_pollute_output(tables, expected):
     result = buf.read()
 
     assert result == expected
+
+
+def test_write_csv_custom_delimiter_from_parse_options():
+    import pyarrow.dataset as ds
+
+    table = pa.table({
+        "B": ["B1", "B2"],
+        "C": ["C1", "C2"],
+    })
+
+    # Verify that CsvFileFormat.make_write_options propagates the
+    # parse delimiter to write options when no explicit delimiter is given
+    for delimiter in [">", "|", "\t", ";"]:

Review Comment:
   Totally agree.



##########
cpp/src/arrow/dataset/file_csv_test.cc:
##########
@@ -449,6 +449,24 @@ TEST_P(TestCsvFileFormat, 
WriteRecordBatchReaderCustomOptions) {
   ASSERT_EQ("0\n0\n0\n0\n0\n", written->ToString());
 }
 
+TEST_P(TestCsvFileFormat, WriteRecordBatchReaderDelimiterPropagation) {
+  // Verify that CsvFileFormat::DefaultWriteOptions() propagates the parse
+  // delimiter to write options
+  for (const char delim : {'>', '|', '\t', ';'}) {

Review Comment:
   Totally agree.



-- 
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]

Reply via email to