You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(duckplyr)
Sys.setenv(DUCKPLYR_FALLBACK_COLLECT=1)
df<- tibble(x=1:5, y=6:10)
df<- as_duckplyr_df(df)
mutate(df, across(x:y, \(arg) mean(arg, na.rm=TRUE)))
#> Error in `as_string()`:#> ! Can't convert an internal string to a string.
Minimal reprex:
name_map<- c(
"...1",
"...2",
"...3"
)
names(name_map) <- c("x", "y", "")
expr<- quote(
across(x:y, function(arg) mean(arg, na.rm=TRUE))
)
# something here is the problemduckplyr:::expr_scrub(expr, name_map)
#> Error in print.default(x): badly formed function expressionbroken<-duckplyr:::expr_scrub(expr, name_map)
rlang::expr_deparse(broken)
#> Error in `as_string()`:#> ! Can't convert an internal string to a string.
The text was updated successfully, but these errors were encountered:
It seems to fail when scrubbing the function definition which results in a "badly formed function expression". More specifically, it cannot handle the parameters which are stored in a pairlist (this can be observed by switching the last call to paste0 in do_scrub to stop).
Made a PR in which changes the behaviour so that the function parameters and body are scrubbed separately.
A reprex of the results with the example above
name_map<- c(
"...1",
"...2",
"...3"
)
names(name_map) <- c("x", "y", "z")
name_map#> x y z #> "...1" "...2" "...3"expr<- quote(
across(x:y, function(arg) mean(arg, na.rm=TRUE))
)
# something here is the problemduckplyr:::expr_scrub(expr, name_map)
#> across(...1:...2, (function(arg) mean(...4, na.rm = TRUE))())
Minimal reprex:
The text was updated successfully, but these errors were encountered: