tidyverse / dbplyr

Database (DBI) backend for dplyr
https://dbplyr.tidyverse.org
Other
474 stars 173 forks source link

`rows_patch.tbl_lazy` fails when patching more than one column #1443

Closed gorcha closed 8 months ago

gorcha commented 8 months ago

The tbl_lazy version of rows_patch() throws an error if more than one column is to be updated. There's a simple bug in the code that builds the coalesce calls, PR is incoming!

library(dplyr)
library(dbplyr)

rows_patch(
  memdb_frame(x = 1:3, y = c(11, 12, NA), z = c(31, NA, 33)),
  memdb_frame(x = 2:3, y = 22:23, z = 42:43),
  by = "x",
  unmatched = "ignore",
  in_place = FALSE
)
#> Error in `sym()`:
#> ! Can't convert a character vector to a symbol.

Created on 2024-01-31 with reprex v2.1.0