You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/15 18:45:02 UTC

[GitHub] [arrow] nealrichardson commented on a change in pull request #7415: ARROW-7028: [R] Date roundtrip results in different R storage mode

nealrichardson commented on a change in pull request #7415:
URL: https://github.com/apache/arrow/pull/7415#discussion_r440371130



##########
File path: r/tests/testthat/test-Array.R
##########
@@ -202,6 +202,8 @@ test_that("array supports Date (ARROW-3340)", {
   expect_array_roundtrip(d2, date32())
   # PSA: IngestDoubleRange(Date32Builder) truncates decimals, so this only
   # works where the dates are integer-ish
+
+  expect_equal(typeof(Array$create(d)$as_vector()), "double")

Review comment:
       If we want to assert about R storage type, I'd move the into `expect_array_roundtrip()` defined at the top of this file, below L30:
   
   ```r
   expect_identical(typeof(as.vector(a)), typeof(x))
   ```
   
   so that we can test all types. (I did this locally just now on master, and only Date fails.)
   
   I also wonder if it would be good to add a test here with `dplyr::if_else` to reproduce the original issue. IMO the storage mode is only interesting because of the behavior side effects.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org