dragosmg commented on a change in pull request #12433:
URL: https://github.com/apache/arrow/pull/12433#discussion_r811036678



##########
File path: r/R/dplyr-funcs-datetime.R
##########
@@ -147,5 +147,7 @@ register_bindings_datetime <- function() {
   register_binding("pm", function(x) {
     !call_binding("am", x)
   })
-
+  register_binding("date", function(x) {
+    x$cast(date32())
+  })

Review comment:
       Q1: I have added some unit tests for _unsupported_ types. And discovered 
that, unlike {lubridate}, you can cast a `date` from an `integer` in {arrow}. 
It looks like the integer is interpreted as number of days since epoch. 
   ``` r
   suppressPackageStartupMessages(library(arrow))
   call_binding("date", Scalar$create(32L))
   #> Scalar
   #> 1970-02-02
   
   lubridate::date(32L)
   #> Error in as.POSIXlt.numeric(x, tz = tz(x)): 'origin' must be supplied
   ```
   
   <sup>Created on 2022-02-21 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: github-unsubscr...@arrow.apache.org

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


Reply via email to