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

paste0() incorrectly uses a sep argument #1473

Open
DavisVaughan opened this issue Mar 5, 2024 · 0 comments
Open

paste0() incorrectly uses a sep argument #1473

DavisVaughan opened this issue Mar 5, 2024 · 0 comments

Comments

@DavisVaughan
Copy link
Member

My wife was confused by the fact that paste0(sep =) was actually translating the same way as paste(sep =). Turns out that in our translation, we accept the sep named argument in both cases, when really we should treat sep = as part of the ... in the case of paste0() translations (or maybe even warn if we see paste0(sep =)?).

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

con <- simulate_postgres()
df <- lazy_frame(a = "x", b = "y", con = con)

# This is not right!
df |>
  mutate(c = paste0(a, b, sep = "_"))
#> <SQL>
#> SELECT *, CONCAT_WS('_', `a`, `b`) AS `c`
#> FROM `df`

Created on 2024-03-05 with reprex v2.0.2

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

No branches or pull requests

1 participant