You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since {dbplyr} 2.3.0 I cannot select columns from a lazy table using a vector of column names.
My distinct(across(all_of(...))) code is no longer working, not even with pick(...) .
library(dplyr)
library(dbplyr)
df<-mtcarsvec_cols<- c("gear", "cyl")
# newly deprecated in dplyr 1.1.0?df|> distinct(across(all_of(vec_cols)))
#> gear cyl#> Mazda RX4 4 6#> Datsun 710 4 4#> Hornet 4 Drive 3 6#> Hornet Sportabout 3 8#> Toyota Corona 3 4#> Porsche 914-2 5 4#> Ford Pantera L 5 8#> Ferrari Dino 5 6df|> distinct(across(.cols= all_of(vec_cols)))
#> gear cyl#> Mazda RX4 4 6#> Datsun 710 4 4#> Hornet 4 Drive 3 6#> Hornet Sportabout 3 8#> Toyota Corona 3 4#> Porsche 914-2 5 4#> Ford Pantera L 5 8#> Ferrari Dino 5 6# Suggested replacement: working finedf|> distinct(pick(all_of(vec_cols)))
#> gear cyl#> Mazda RX4 4 6#> Datsun 710 4 4#> Hornet 4 Drive 3 6#> Hornet Sportabout 3 8#> Toyota Corona 3 4#> Porsche 914-2 5 4#> Ford Pantera L 5 8#> Ferrari Dino 5 6
With dbplyr (I tried MSSQL and SQLite backends):
df_lazy<-dbplyr::tbl_lazy(df=mtcars, con= simulate_mssql())
# used to workdf_lazy|> distinct(across(all_of(vec_cols)))
#> Error in is_missing(x): promise already under evaluation: recursive default argument reference or earlier problems?df_lazy|> distinct(across(.cols= all_of(vec_cols)))
#> Error in is_missing(x): promise already under evaluation: recursive default argument reference or earlier problems?# not workingdf_lazy|> distinct(pick(all_of(vec_cols)))
#> Error in var_is_null[[cur_var]] <- FALSE: attempt to select less than one element in OneIndex
I have also tried to force evaluation of vec_cols with !! but it didn't get it to work.
Am I using pick() and across() wrong now?
Since {dbplyr} 2.3.0 I cannot select columns from a lazy table using a vector of column names.
My
distinct(across(all_of(...)))
code is no longer working, not even withpick(...)
.With dbplyr (I tried MSSQL and SQLite backends):
I have also tried to force evaluation of
vec_cols
with !! but it didn't get it to work.Am I using
pick()
andacross()
wrong now?Created on 2023-02-03 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: