-
Notifications
You must be signed in to change notification settings - Fork 4k
MINOR: [R] Work around test failure in tidyquery revdep #43498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,7 +201,12 @@ try_arrow_dplyr <- function(expr) { | |
| parent <- caller_env() | ||
| # Make sure that the call is available in the parent environment | ||
| # so that we can use it in abandon_ship, if needed | ||
| evalq(call <- match.call(), parent) | ||
| # (but don't error if we're in some weird context where we can't get the call, | ||
| # which could happen if you're code-generating or something?) | ||
| try( | ||
| evalq(call <- match.call(), parent), | ||
| silent = !getOption("arrow.debug", FALSE) | ||
| ) | ||
|
|
||
| tryCatch( | ||
| eval(expr, parent), | ||
|
|
@@ -217,7 +222,10 @@ try_arrow_dplyr <- function(expr) { | |
| # and that the function being called also exists in the dplyr namespace. | ||
| abandon_ship <- function(err, env) { | ||
| .data <- get(".data", envir = env) | ||
| if (query_on_dataset(.data)) { | ||
| # If there's no call (see comment in try_arrow_dplyr), we can't eval with | ||
| # dplyr even if the data is in memory already | ||
| call <- try(get("call", envir = env), silent = TRUE) | ||
| if (query_on_dataset(.data) || inherits(call, "try-error")) { | ||
| # Add a note suggesting `collect()` to the error message. | ||
| # If there are other suggestions already there (with the > arrow name), | ||
| # collect() isn't the only suggestion, so message differently | ||
|
|
@@ -231,7 +239,6 @@ abandon_ship <- function(err, env) { | |
| } | ||
|
|
||
| # Else, warn, collect(), and run in regular dplyr | ||
| call <- get("call", envir = env) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little surprised by this deletion, was this essentially overwritting what was in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just moved it up to L227
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AAAAAH I totally missed that. Thanks |
||
| rlang::warn( | ||
| message = paste0("In ", format_expr(err$call), ": "), | ||
| body = c("i" = conditionMessage(err), ">" = "Pulling data into R") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.