In dplyr a nested tibble is created which is not possible in dbplyr, so this should error
library(dplyr, warn.conflicts = FALSE)
suppressMessages(devtools::load_all("~/GitHub/dbplyr/"))
tibble(a = 1, b = 2) %>%
mutate(a = 2, x = across())
#> # A tibble: 1 × 3
#> a b x$a $b
#> <dbl> <dbl> <dbl> <dbl>
#> 1 2 2 2 2
lazy_frame(a = 1, b = 2) %>%
mutate(a = 2, x = across())
#> <SQL>
#> SELECT `a`, `b`
#> FROM (
#> SELECT 2.0 AS `a`, `b`
#> FROM `df`
#> ) `q01`
Created on 2022-01-19 by the reprex package (v2.0.1)
TEST
test_that("mutate() error if gets multiple columns in across()", {
df <- lazy_frame(a = 1, b = 2)
expect_snapshot({
(expect_error(mutate(df, a = 2, x = across())))
})
})
In
dplyra nested tibble is created which is not possible indbplyr, so this should errorCreated on 2022-01-19 by the reprex package (v2.0.1)
TEST