Skip to content

Commit

Permalink
Fixes for dev rlang
Browse files Browse the repository at this point in the history
Now has stricter definition of `is_expression()` that only allows parse-able calls.
  • Loading branch information
hadley committed Oct 4, 2021
1 parent 5b3daf0 commit 07b93b4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Imports:
ellipsis,
glue,
lifecycle,
rlang,
rlang (>= 0.4.11.9001),
tibble,
tidyselect,
vctrs
Expand All @@ -47,3 +47,5 @@ Encoding: UTF-8
Roxygen: {library(tidyr); list(markdown = TRUE)}
RoxygenNote: 7.1.2
Config/testthat/edition: 3
Remotes:
r-lib/rlang
4 changes: 2 additions & 2 deletions R/step-subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ step_subset <- function(parent,
) {

stopifnot(is_step(parent))
stopifnot(is.null(i) || is_expression(i) || is_step(i))
stopifnot(is.null(j) || is_expression(j))
stopifnot(is_expression(i) || is_call(i) || is_step(i))
stopifnot(is_expression(j) || is_call(j))
stopifnot(is.character(on))

new_step(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/step-subset-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Code
out <- lz %>% group_by(x) %>% select()
Message <message>
Message <rlang_message>
Adding missing grouping variables: `x`

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/step-subset-summarise.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Code
eval_bare(expr(lazy_dt(data.frame(x = 1, y = 2), "DT") %>% group_by(x, y) %>%
dplyr::summarise() %>% show_query()), env(global_env()))
Message <message>
Message <rlang_message>
`summarise()` has grouped output by 'x'. You can override using the `.groups` argument.
Output
unique(DT)
Expand Down

0 comments on commit 07b93b4

Please sign in to comment.