dragosmg commented on code in PR #12757:
URL: https://github.com/apache/arrow/pull/12757#discussion_r853914877
##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -351,6 +351,25 @@ register_bindings_duration <- function() {
delta <- delta$cast(int64())
start + delta$cast(duration("s"))
})
+ register_binding("make_difftime", function(num = NULL,
+ units = "secs",
+ ...) {
+ if (units != "secs") {
+ abort("`make_difftime()` with units other than 'secs' not supported in
Arrow")
+ }
+
+ chunks <- list(...)
+
+ if (is.null(num)) {
+ duration <- duration_from_chunks(chunks)
+ } else if (length(chunks) == 0) {
+ duration <- num
+ } else {
+ abort("`make_difftime()` with both `num` and `...` not supported in
Arrow")
+ }
+ duration <- build_expr("cast", duration, options = cast_options(to_type =
int64()))
Review Comment:
I'd be in favour of having a separate Jira for this, so I've created one:
[ARROW-16253](https://issues.apache.org/jira/browse/ARROW-16253).
--
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]