tests/testthat/_snaps/dplyr-distinct.md

distinct errors when selecting an unknown column (#3140)

Code
  df <- tibble(g = c(1, 2), x = c(1, 2))
  (expect_error(df %>% duckplyr_distinct(aa, x)))
Output
  <error/rlang_error>
  Error in `distinct()`:
  ! Must use existing variables.
  x `aa` not found in `.data`.
Code
  (expect_error(df %>% duckplyr_distinct(aa, bb)))
Output
  <error/rlang_error>
  Error in `distinct()`:
  ! Must use existing variables.
  x `aa` not found in `.data`.
  x `bb` not found in `.data`.
Code
  (expect_error(df %>% duckplyr_distinct(.data$aa)))
Output
  <error/rlang_error>
  Error in `distinct()`:
  ! Must use existing variables.
  x `aa` not found in `.data`.
Code
  (expect_error(df %>% duckplyr_distinct(y = a + 1)))
Output
  <error/dplyr:::mutate_error>
  Error in `distinct()`:
  i In argument: `y = a + 1`.
  Caused by error:
  ! object 'a' not found


Try the duckplyr package in your browser

Any scripts or data that you put into this service are public.

duckplyr documentation built on June 8, 2025, 10:53 a.m.