Skip to content

Commit

Permalink
Simplify deprecation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Oct 25, 2024
1 parent 0beeca4 commit a05c2fe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 51 deletions.
17 changes: 1 addition & 16 deletions R/eval-walk.R
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,6 @@ eval_sym <- function(expr, data_mask, context_mask, strict = FALSE) {
lifecycle::deprecate_soft("1.1.0",
what = I("Use of bare predicate functions"),
with = I("`where()` to wrap predicate functions"),
details = c(
" " = "# Was:",
" " = glue("data %>% select({name})"),
"",
" " = "# Now:",
" " = glue("data %>% select(where({name}))")
),
user_env = env
)

Expand All @@ -450,15 +443,7 @@ eval_sym <- function(expr, data_mask, context_mask, strict = FALSE) {
lifecycle::deprecate_soft("1.1.0",
I("Using an external vector in selections"),
I("`all_of()` or `any_of()`"),
details = c(
" " = "# Was:",
" " = glue("data %>% select({name})"),
"",
" " = "# Now:",
" " = glue("data %>% select(all_of({name}))"),
"",
"See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>."
),
details = "See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.",
user_env = env
)

Expand Down
9 changes: 2 additions & 7 deletions man/faq-external-vector.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/starts_with.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 1 addition & 27 deletions tests/testthat/_snaps/eval-walk.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@
Warning:
Using an external vector in selections was deprecated in tidyselect 1.1.0.
i Please use `all_of()` or `any_of()` instead.
# Was:
data %>% select(vars)
# Now:
data %>% select(all_of(vars))
See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
i See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
Output
a b
1 2
Expand Down Expand Up @@ -100,45 +94,25 @@
Warning:
Use of bare predicate functions was deprecated in tidyselect 1.1.0.
i Please use `where()` to wrap predicate functions instead.
# Was:
data %>% select(is_integer)
# Now:
data %>% select(where(is_integer))
Code
invisible(select_loc(iris, is.numeric))
Condition
Warning:
Use of bare predicate functions was deprecated in tidyselect 1.1.0.
i Please use `where()` to wrap predicate functions instead.
# Was:
data %>% select(is.numeric)
# Now:
data %>% select(where(is.numeric))
Code
invisible(select_loc(iris, isTRUE))
Condition
Warning:
Use of bare predicate functions was deprecated in tidyselect 1.1.0.
i Please use `where()` to wrap predicate functions instead.
# Was:
data %>% select(isTRUE)
# Now:
data %>% select(where(isTRUE))
Code
# Warning is not repeated
invisible(select_loc(iris, is_integer))
Condition
Warning:
Use of bare predicate functions was deprecated in tidyselect 1.1.0.
i Please use `where()` to wrap predicate functions instead.
# Was:
data %>% select(is_integer)
# Now:
data %>% select(where(is_integer))

# eval_walk() errors when formula shorthand are not wrapped

Expand Down

0 comments on commit a05c2fe

Please sign in to comment.