-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transmute does not work with DBI #3370
Comments
Hi, I just tried that out and it worked in my computer: suppressPackageStartupMessages({
library(dplyr)
library(dbplyr)
})
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
copy_to(con, mtcars)
mtcars2 <- tbl(con, "mtcars")
transmute(mtcars2, blah = cyl)
#> # Source: lazy query [?? x 1]
#> # Database: sqlite 3.19.3 [:memory:]
#> blah
#> <dbl>
#> 1 6.00
#> 2 6.00
#> 3 4.00
#> 4 6.00
#> 5 8.00
#> 6 6.00
#> 7 8.00
#> 8 4.00
#> 9 4.00
#> 10 6.00
#> # ... with more rows
DBI::dbDisconnect(con) Maybe you may need to upgrade your packages? |
Thanks, @edgararuiz. I'm on dplyr 0.7.4 and dbplyr 1.2.1 so I don't think those should be the issue. Here's my session info in case there's something I'm missing.
|
Can you please try updating tidyselect ? |
dbplyr now uses tidyselect and it looks like tidyselect doesn't hotpatch dplyr for some reason. This problem should go away once the next version of dplyr comes out. |
Thanks. I don't understand "hotpatch". |
This ugly thing here :) https://github.com/tidyverse/tidyselect/blob/master/R/tidyselect.R#L9 Necessary because tidyr uses tidyselect but not dplyr (and now dbplyr uses it as well). |
I still don't understand, tidyr does import dplyr even in v0.8.0. |
yes but since tidyr uses tidyselect the variable context from the select helpers (which are exported from dplyr) must be the one from tidyselect. |
@krlmlr I updated tidyselect as you suggested but I am still getting the same error. These are the versions I'm currently running: |
@lionel-: Do you think reinstalling dplyr can help? |
I don't know what's going on. If you install the dev version it should work though. |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
transmute()
exhibits desired behavior with data frames but throws an error when used in the context of a DBI.The text was updated successfully, but these errors were encountered: