-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
case_when()
error path isn't working correctly
#6261
Comments
Causing #6206 |
Introduced by #6052 when there was an internal switch from We now do: msg <- glue("{header} must be {friendly_type_of(template)}, not {friendly_type_of(x)}.")
abort(msg, call = error_call) Where We used to do: glubort(header, "must be {friendly_type_of(template)}, not {friendly_type_of(x)}.") Where
The previous code wouldn't give the best result, but it would at least kind of work (this is dplyr 1.0.0): > case_when(TRUE ~ 1, TRUE ~ "x")
Error in `glubort()`:
! must be a double vector, not a character vector.
Run `rlang::last_error()` to see where the error occurred. |
These are supposed to report on invalid types and classes, respectively.
This happens because we are missing an argument here in
replace_with()
. ThatNULL
is probably intended to be passed on toreason
, but it is instead being matched toname
and that doesn't work. A character name is required for that error path to run correctly.dplyr/R/case_when.R
Line 174 in 1cff4b9
The text was updated successfully, but these errors were encountered: