-
Notifications
You must be signed in to change notification settings - Fork 2.1k
order_by() with call to lag() (but not dplyr::lag()) causing crash #3065
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
Comments
Following up: I confirm I experience the same crashing in R 3.4.0, dplyr 0.7.2 on Mac OS X El Capitan. Running
|
Using library(dplyr)
library(rlang)
# example data
data <- data_frame(
ordering = 1:10,
y = 1:10
)
# reproduce the call argument
call <- lag(data$y)
# quo instead of enquo inside of order_by
quo <- quo(!!call)
# this expression is ok
temp1 <- get_expr(quo)
# this one make the r session crashed
temp2 <- node_car(temp1)
library(rlang)
data <- dplyr::data_frame(
ordering = 1:10,
y = 1:10
)
call <- dplyr::lag(data$y)
quo <- quo(!!call)
temp1 <- get_expr(quo)
temp1
#> [1] NA 1 2 3 4 5 6 7 8 9
is_expr(temp1)
#> [1] FALSE
is_formula(temp1)
#> [1] FALSE
class(temp1)
#> [1] "integer" I think it is the reason why it is crashing. library(rlang)
data <- dplyr::data_frame(
ordering = 1:10,
y = 1:10
)
quo <- quo(dplyr::lag(data$y))
temp1 <- get_expr(quo)
temp1
#> dplyr::lag(data$y)
is_expr(temp1)
#> [1] TRUE
is_formula(temp1)
#> [1] FALSE
class(temp1)
#> [1] "call"
temp2 <- node_car(temp1)
However, there will still be a I hope this help understand. |
Nope, the check should have been this line in stopifnot(is_lang(quo)) because in early rlang versions stopifnot(quo_is_lang(quo)) |
Could not have known this one but could have guess it. 😉 indeed there is a check in This new check will prevent the crash of r session. |
@krlmlr The issue here, besides the wrong type checking, is that the hybrid handler preemptively replaces the |
Yes, we have a whole battery of skipped tests. The underlying issue is the ad-hoc argument matching, ideally we'd like to do the argument matching properly and only once, not for every group. There's an open issue for this problem. Can we close this ticket? |
On Windows 10 Enterprise, I am experiencing crashes in R 3.4.1 when using the
order_by()
helper function (as in the window function vignette) withlag()
in dplyr 0.7.2, tidyverse 1.1.1. As you can see below, it works withdplyr::lag()
but not unspecifiedlag()
so perhaps some namespace issue?After running the last block of code, my R session gives a crash error message and must be restarted:
The text was updated successfully, but these errors were encountered: