Skip to content

Commit

Permalink
Update snapshots for tidyselect 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Mar 12, 2024
1 parent d698022 commit 985b17a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/across.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
Error in `summarise()`:
i In argument: `across(y, mean)`.
Caused by error in `across()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `y` doesn't exist.
Code
(expect_error(tibble(x = 1) %>% summarise(res = across(where(is.numeric), 42))))
Expand All @@ -105,7 +105,7 @@
Error in `summarise()`:
i In argument: `z = across(y, mean)`.
Caused by error in `across()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `y` doesn't exist.
Code
(expect_error(tibble(x = 1) %>% summarise(res = sum(if_any(where(is.numeric),
Expand Down Expand Up @@ -314,7 +314,7 @@
i In argument: `y = c_across(g)`.
i In group 1: `g = 1`.
Caused by error in `c_across()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `g` doesn't exist.

# across() applies old `.cols = everything()` default with a warning
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/by.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
compute_by(by = y, data = df)
Condition
Error:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `y` doesn't exist.

# can't set `.by` with a grouped-df
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/colwise-mutate.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Output
<error/vctrs_error_subscript_oob>
Error in `tbl_at_vars()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `test` doesn't exist.
Code
tbl <- tibble(gr1 = rep(1:2, 4), gr2 = rep(1:2, each = 4), x = 1:8)
Expand All @@ -39,7 +39,7 @@
Output
<error/vctrs_error_subscript_oob>
Error in `tbl_at_vars()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `gr1` doesn't exist.
Code
(expect_error(mutate_all(mtcars, length, 0, 0)))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
select(mtcars, 1 + "")
Condition
Error in `foo()`:
! Problem while evaluating `1 + ""`.
i In argument: `1 + ""`.
Caused by error in `1 + ""`:
! non-numeric argument to binary operator
Code
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/group-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Output
<error/vctrs_error_subscript_oob>
Error in `ungroup()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `z` doesn't exist.
Code
(expect_error(df %>% group_by(z = a + 1)))
Expand Down
26 changes: 15 additions & 11 deletions tests/testthat/_snaps/pick.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Error in `mutate()`:
i In argument: `y = pick(g)`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `g` doesn't exist.

---
Expand All @@ -42,7 +42,7 @@
i In argument: `y = pick_wrapper(g)`.
i In group 1: `g = 1`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `g` doesn't exist.

# must supply at least one selector to `pick()`
Expand Down Expand Up @@ -73,7 +73,7 @@
Error in `mutate()`:
i In argument: `y = pick(x)`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `x` doesn't exist.

---
Expand All @@ -85,7 +85,7 @@
i In argument: `y = pick_wrapper(x)`.
i In group 1: `g = 1`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `x` doesn't exist.

# can call `pick()` from a user defined function
Expand All @@ -96,9 +96,11 @@
Error in `mutate()`:
i In argument: `d = my_pick()`.
i In group 1: `a = 1`.
Caused by error in `pick()`:
i In argument: `all_of(x)`.
Caused by error in `all_of()`:
! Can't subset columns that don't exist.
x Column `a` doesn't exist.
! Can't subset elements that don't exist.
x Element `a` doesn't exist.

---

Expand All @@ -108,9 +110,11 @@
Error in `mutate()`:
i In argument: `d = my_pick(y)`.
i In group 1: `a = 1`.
Caused by error in `pick()`:
i In argument: `all_of(x)`.
Caused by error in `all_of()`:
! Can't subset columns that don't exist.
x Column `a` doesn't exist.
! Can't subset elements that don't exist.
x Element `a` doesn't exist.

# errors correctly outside mutate context

Expand Down Expand Up @@ -168,7 +172,7 @@
Error in `arrange()`:
i In argument: `..1 = pick(y)`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `y` doesn't exist.

---
Expand All @@ -189,7 +193,7 @@
Error in `filter()`:
i In argument: `pick(x, a)`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `a` doesn't exist.

---
Expand All @@ -200,7 +204,7 @@
Error in `filter()`:
i In argument: `pick_wrapper(x, a)`.
Caused by error in `pick()`:
! Can't subset columns that don't exist.
! Can't select columns that don't exist.
x Column `a` doesn't exist.

# `filter()` that doesn't use `pick()` result correctly errors
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Output
<error/rlang_error>
Error in `select()`:
! Problem while evaluating `1 + ""`.
i In argument: `1 + ""`.
Caused by error in `1 + ""`:
! non-numeric argument to binary operator

Expand All @@ -41,7 +41,7 @@
Output
<error/vctrs_error_subscript_oob>
Error in `select()`:
! Can't subset columns past the end.
! Can't select columns past the end.
i Location 2 doesn't exist.
i There is only 1 column.
Code
Expand All @@ -60,7 +60,7 @@
Output
<error/vctrs_error_subscript_oob>
Error in `select()`:
! Can't subset columns past the end.
! Can't select columns past the end.
i Location 2 doesn't exist.
i There is only 1 column.
Code
Expand Down

0 comments on commit 985b17a

Please sign in to comment.