dragosmg commented on a change in pull request #12319:
URL: https://github.com/apache/arrow/pull/12319#discussion_r801545663
##########
File path: r/R/dplyr-funcs-type.R
##########
@@ -248,3 +249,33 @@ register_bindings_type_elementwise <- function() {
is_inf & !call_binding("is.na", is_inf)
})
}
+
+register_bindings_type_format <- function() {
+ register_binding("format", function(x, ...) {
+ if (inherits(x, "Expression") &&
+ x$type_id() %in% Type[c("TIMESTAMP", "DATE32", "DATE64")]) {
+ binding_format_datetime(x, ...)
+ } else {
+ abort(paste0("`format()` not yet supported for `", class(x$type())[[1]],
"`"))
Review comment:
In order to mimic the behaviour of the R function, I'd be in favour of
abandoning ship here and delegating the execution to R. Maybe switch to casting
to string (with `x$cast(string())`) once we have handled at least a few of the
most common types.
--
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]