You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/14 23:07:44 UTC

[GitHub] [arrow] dragosmg commented on a diff in pull request #13160: ARROW-14575: [R] Allow functions with {{pkg::}} prefixes

dragosmg commented on code in PR #13160:
URL: https://github.com/apache/arrow/pull/13160#discussion_r873083697


##########
r/R/dplyr-funcs.R:
##########
@@ -58,7 +58,8 @@ NULL
 #' @keywords internal
 #'
 register_binding <- function(fun_name, fun, registry = nse_funcs) {
-  name <- gsub("^.*?::", "", fun_name)
+  # test name <- gsub("^.*?::", "", fun_name)
+  name <- gsub("^.*?_", "", fun_name)
   namespace <- gsub("::.*$", "", fun_name)
 
   previous_fun <- if (name %in% names(registry)) registry[[name]] else NULL

Review Comment:
   I need to add some logic to clean-up both names



##########
r/R/dplyr-mutate.R:
##########
@@ -57,7 +64,7 @@ mutate.arrow_dplyr_query <- function(.data,
     if (inherits(results[[new_var]], "try-error")) {
       msg <- handle_arrow_not_supported(
         results[[new_var]],
-        format_expr(exprs[[i]])
+        format_expr(exprs2[[i]])

Review Comment:
   we return the original expression in case of error, `"lubridate::as_datetime()"`, instead of `"lubridate_as_datime()"` to avoid confusion.



##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -303,7 +303,7 @@ register_bindings_datetime_conversion <- function() {
     )
   })
 
-  register_binding("as_datetime", function(x,
+  register_binding("lubridate_as_datetime", function(x,

Review Comment:
   only did this for 2 bindings: `as_datetime` and `make_difftime`



-- 
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-unsubscribe@arrow.apache.org

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