jonkeane commented on a change in pull request #12240:
URL: https://github.com/apache/arrow/pull/12240#discussion_r791756282



##########
File path: r/tests/testthat/test-Array.R
##########
@@ -985,3 +985,14 @@ test_that("Array to C-interface", {
   delete_arrow_schema(schema_ptr)
   delete_arrow_array(array_ptr)
 })
+
+test_that("Array coverts timestamps with missing timezone /assumed local tz 
correctly", {
+  withr::with_envvar(c(TZ = "America/Chicago"), {
+    a <- as.POSIXct("1970-01-01 00:00:00")
+    attr(a, "tzone") <- Sys.getenv("TZ")

Review comment:
       > But wouldn't those arrays be equal in their absolute value (without 
the "tzone" medatadata)
   
   This is what we expect + want, no? R creates a POSIXct by taking the 
datetime string you have and converting it to the number of seconds from the 
epoch based on the time string being in the local timezone of the session 
(unless you proactively provide a different one). This is what I mean when I 
say that for R the timezoneless timestamps are *not* naive, they are really 
timestamps at a specific timezone, R just happens to spell that timezone 
confusingly as `""` sometimes.




-- 
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: github-unsubscr...@arrow.apache.org

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


Reply via email to