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



##########
File path: r/R/dplyr-funcs-datetime.R
##########
@@ -189,6 +189,70 @@ register_bindings_datetime <- function() {
   })
 }
 
+register_bindings_duration <- function() {
+  register_binding("difftime", function(time1,
+                                        time2,
+                                        tz,
+                                        units = c("auto", "secs", "mins",
+                                                  "hours", "days", "weeks")) {
+    units <- match.arg(units)
+    if (units != "secs") {
+      abort("`difftime()` with units other than seconds not supported in 
Arrow")
+    }
+
+    # for time32() we do not need to worry about timezone
+    if (call_binding("is.instant", time1) & call_binding("is.instant", time2)) 
{

Review comment:
       Ah ok, yeah date32, date64, and timestamp all have TZ attributes in 
Arrow, but time32 and time64 do not. 
   
   > therefore we might want to recast to make sure
   
   Let's construct (and maybe you have below and can point to them — but I 
didn't see something obvious that was this!) test cases where (re)casting them 
would change the answer. I suspect we might be slightly confusing the TZ 
attribute on the object and the TZ argument as an argument (or at least, I 
don't 100% see what cases would have issues that would need this recasting).




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