wjones127 commented on code in PR #15270:
URL: https://github.com/apache/arrow/pull/15270#discussion_r1064918514


##########
r/tests/testthat/test-csv.R:
##########
@@ -664,3 +664,27 @@ test_that("Shows an error message when trying to read a 
timestamp with time zone
     "CSV conversion error to timestamp\\[ns\\]: expected no zone offset in"
   )
 })
+
+test_that("CSV reading/parsing/convert options can be passed in as lists", {
+  tf <- tempfile()
+  on.exit(unlink(tf))
+
+  writeLines('"x"\nNA\nNA\n"NULL"\n\n"foo"\n', tf, )
+  readLines(tf)

Review Comment:
   Although, is this the right output? I'm not sure the null values are being 
parsed correctly or `ignore_empty_lines` is working, but `skip_rows` does seem 
to be working.
   
   ```r
   > library(arrow)
   
   Attaching package: ‘arrow’
   
   The following object is masked from ‘package:utils’:
   
       timestamp
   
   > buf <- buffer(charToRaw('"x"\nNA\nNA\n"NULL"\n\n"foo"\n'))
   > tab1 <- read_csv_arrow(
   +     buf,
   +     convert_options = list(null_values = c("NA", "NULL")),
   +     parse_options = list(ignore_empty_lines = FALSE),
   +     read_options = list(skip_rows = 1L)
   +   )
   > tab1
       NA
   1   NA
   2 NULL
   3     
   4  foo
   ```



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