An error is produced when trying to use distinct(..., .keep_all = TRUE) within the second argument of a filtering join. The error does not occur when used within the first argument of a filtering join, within either argument of a mutating join, or when using .keep_all = FALSE.
df1 <- dbplyr::lazy_frame(id = 1)
df2 <- dbplyr::lazy_frame(id = 1)
anti_join(df1, df2 |> distinct(id, .keep_all = TRUE))
Error in `get_env()`:
! Can't extract an environment from a call.