Skip to content
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

where() within across() no longer works as expected #1169

Closed
nannerhammix opened this issue Feb 21, 2023 · 1 comment · Fixed by #1170
Closed

where() within across() no longer works as expected #1169

nannerhammix opened this issue Feb 21, 2023 · 1 comment · Fixed by #1170

Comments

@nannerhammix
Copy link

It appears that across(where(is.)),...) no longer works to convert columns based on the underlying type.

library(dplyr, warn.conflicts = FALSE)
library(dbplyr, warn.conflicts = FALSE)

temp <- memdb_frame(x = 1:10)

temp
#> # Source:   table<dbplyr_001> [10 x 1]
#> # Database: sqlite 3.33.0 [:memory:]
#>        x
#>    <int>
#>  1     1
#>  2     2
#>  3     3
#>  4     4
#>  5     5
#>  6     6
#>  7     7
#>  8     8
#>  9     9
#> 10    10

temp %>%
  mutate(across(where(is.integer), as.character)) %>%
  sql_render()
#> <SQL> SELECT *
#> FROM `dbplyr_001`

While the expected generated query would be:

SELECT CAST(`x` AS TEXT) AS `x`
FROM `dbplyr_001`
@mgirlich
Copy link
Collaborator

Predicates never really worked and already produced an error when used in select(). This error was missing for across() and is now added by #1170.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants