Skip to content

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

Closed
@nannerhammix

Description

@nannerhammix

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions