jonkeane commented on a change in pull request #12474:
URL: https://github.com/apache/arrow/pull/12474#discussion_r817229371
##########
File path: r/tests/testthat/test-csv.R
##########
@@ -541,4 +541,16 @@ test_that("write_csv_arrow can write from
RecordBatchReader objects", {
tbl_in <- read_csv_arrow(csv_file)
expect_named(tbl_in, c("dbl", "lgl", "false", "chr"))
expect_equal(nrow(tbl_in), 3)
+
})
+
+test_that("read_csv_arrow() can read sub-second timestamps with col_types T
setting (ARROW-15599)", {
+ tbl <- tibble::tibble(time = c("2018-10-07 19:04:05.000", "2018-10-07
19:04:05.001"))
+ tf <- tempfile()
+ on.exit(unlink(tf))
+ write.csv(tbl, tf, row.names = FALSE)
+
+ df <- read_csv_arrow(tf, col_types = "T", col_names = "time", skip = 1)
+ expected <- as.POSIXct(tbl$time, tz = "UTC")
+ expect_equal(df$time, expected, ignore_attr = "tzone")
+})
Review comment:
```suggestion
})
```
##########
File path: r/tests/testthat/test-csv.R
##########
@@ -541,4 +541,16 @@ test_that("write_csv_arrow can write from
RecordBatchReader objects", {
tbl_in <- read_csv_arrow(csv_file)
expect_named(tbl_in, c("dbl", "lgl", "false", "chr"))
expect_equal(nrow(tbl_in), 3)
+
Review comment:
```suggestion
```
--
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]