cyb70289 commented on a change in pull request #12426:
URL: https://github.com/apache/arrow/pull/12426#discussion_r811529389



##########
File path: cpp/src/arrow/csv/writer_test.cc
##########
@@ -189,6 +198,12 @@ std::vector<WriterTestParams> GenerateTestCases() {
             /*expected_output*/ "", 
expected_status_no_quotes_with_structural(error_val)};
   };
 
+  // Schema/expected message for delimiter test
+  auto schema_custom_delimiter = schema({field("a", int64()), field("b", 
int64())});
+  auto batch_custom_delimiter = R"([{"a": 42, "b": -12}])";
+  auto expected_output_delimiter_tabs = "42\t-12\n";
+  auto expected_output_delimiter_pipe = "42|-12\n";

Review comment:
       Looks duplicated, one test should be enough.

##########
File path: cpp/src/arrow/csv/writer_test.cc
##########
@@ -60,13 +60,15 @@ void PrintTo(const WriterTestParams& p, std::ostream* os) {
 WriteOptions DefaultTestOptions(bool include_header = false,
                                 const std::string& null_string = "",
                                 QuotingStyle quoting_style = 
QuotingStyle::Needed,
-                                const std::string& eol = "\n") {
+                                const std::string& eol = "\n",
+                                const char& delimiter = ',') {

Review comment:
       `const char&` -> `char`

##########
File path: cpp/src/arrow/csv/writer_test.cc
##########
@@ -171,6 +173,13 @@ std::vector<WriterTestParams> GenerateTestCases() {
         "style is \"None\". See RFC4180. Invalid value: ",
         value);
   };
+
+  auto expected_status_illegal_delimiter = [](const char value) {
+    return Status::Invalid(
+        "WriteOptions: delimiter cannot be \\r or \\n or \" or EOL. Invalid 
value: ",
+        value);
+  };

Review comment:
       Move it under line 205 in delimiter test section.




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