dragosmg commented on pull request #12357:
URL: https://github.com/apache/arrow/pull/12357#issuecomment-1035531392


   `NA` will be "contagious" in arrow's `tz()` binding (as opposed to 
`lubridate::tz()` where they aren't):
   ``` r
   suppressMessages(library(arrow))
   suppressMessages(library(lubridate))
   suppressMessages(library(dplyr))
   
   df <- tibble(
     x = as.POSIXct(c("2022-02-07", NA), tz = "Pacific/Marquesas")
   )
   
   df %>% 
     record_batch() %>% 
     mutate(timezone_x = tz(x)) %>%
     collect()
   #> # A tibble: 2 × 2
   #>   x                   timezone_x
   #>   <dttm>              <chr>     
   #> 1 2022-02-07 00:00:00 UTC       
   #> 2 NA                  NA
    
   df %>% 
     mutate(timezone_x = tz(x))
   #> # A tibble: 2 × 2
   #>   x                   timezone_x       
   #>   <dttm>              <chr>            
   #> 1 2022-02-07 00:00:00 Pacific/Marquesas
   #> 2 NA                  Pacific/Marquesas
   
   
   
   ```
   
   <sup>Created on 2022-02-10 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</sup>


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