From 6c4a216c6bcfbf1db18404dd781721397858b12b Mon Sep 17 00:00:00 2001 From: Maximilian Girlich Date: Mon, 2 Jan 2023 08:36:32 +0000 Subject: [PATCH 1/4] Wrap call as list before applying `map()` --- R/optimise-utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/optimise-utils.R b/R/optimise-utils.R index b2997a29d..35de6d6f5 100644 --- a/R/optimise-utils.R +++ b/R/optimise-utils.R @@ -21,5 +21,5 @@ expr_uses_var <- function(x, vars) { return(is_symbol(x, vars)) } - any(purrr::map_lgl(x[-1], expr_uses_var, vars)) + any(purrr::map_lgl(as.list(x[-1]), expr_uses_var, vars)) } From b0914a7f5c2eea723449c1fa75685f85922d88ae Mon Sep 17 00:00:00 2001 From: Maximilian Girlich Date: Mon, 2 Jan 2023 09:21:45 +0000 Subject: [PATCH 2/4] NEWS --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 1968fd0bb..7b6736f8e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # dbplyr (development version) +* Compatibility with purrr 1.0.0 (@mgirlich, #1085). + ## New features * `stringr::str_like()` (new in 1.5.0) is translated to the closest `LIKE` From 12e3b241108ba8a00498892205e4b375bbe0e761 Mon Sep 17 00:00:00 2001 From: Maximilian Girlich Date: Mon, 2 Jan 2023 09:59:09 +0000 Subject: [PATCH 3/4] Require purrr 1.0.0 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a3d404868..81c2e043e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,7 @@ Imports: magrittr, methods, pillar (>= 1.5.0), - purrr (>= 0.3.5), + purrr (>= 1.0.0), R6 (>= 2.2.2), rlang (>= 1.0.6), tibble (>= 1.4.2), From 10b5542758ad284ce46d0edcf620c7800368afa9 Mon Sep 17 00:00:00 2001 From: Maximilian Girlich Date: Mon, 2 Jan 2023 09:59:13 +0000 Subject: [PATCH 4/4] Update snapshots --- tests/testthat/_snaps/escape.md | 4 +++- tests/testthat/_snaps/verb-expand.md | 4 +++- tests/testthat/_snaps/verb-pivot-longer.md | 6 +++++- tests/testthat/_snaps/verb-pivot-wider.md | 8 ++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/testthat/_snaps/escape.md b/tests/testthat/_snaps/escape.md index e9ee8bb26..451545a1b 100644 --- a/tests/testthat/_snaps/escape.md +++ b/tests/testthat/_snaps/escape.md @@ -3,7 +3,9 @@ Code lf %>% filter(a == input$x) %>% show_query() Condition - Error: + Error in `purrr::map_chr()`: + i In index: 1. + Caused by error: ! Cannot translate shiny inputs to SQL. i Do you want to force evaluation in R with (e.g.) `!!input$x` or `local(input$x)`? diff --git a/tests/testthat/_snaps/verb-expand.md b/tests/testthat/_snaps/verb-expand.md index dcacd75fb..9335c05e7 100644 --- a/tests/testthat/_snaps/verb-expand.md +++ b/tests/testthat/_snaps/verb-expand.md @@ -97,7 +97,9 @@ Code tidyr::expand(memdb_frame(x = 1, y = 1), nesting(x, x = x + 1)) Condition - Error in `tidyr::expand()`: + Error in `purrr::map()`: + i In index: 1. + Caused by error in `tidyr::expand()`: ! Names must be unique. x These names are duplicated: * "x" at locations 1 and 2. diff --git a/tests/testthat/_snaps/verb-pivot-longer.md b/tests/testthat/_snaps/verb-pivot-longer.md index d684b9fd8..5c7e11045 100644 --- a/tests/testthat/_snaps/verb-pivot-longer.md +++ b/tests/testthat/_snaps/verb-pivot-longer.md @@ -111,7 +111,11 @@ (expect_error(tidyr::pivot_longer(df, x, values_transform = 1))) Output - Error in `dbplyr_pivot_longer_spec()`: + Error in `purrr::map()`: + i In index: 1. + Caused by error in `map2()`: + i In index: 1. + Caused by error in `dbplyr_pivot_longer_spec()`: ! Can't convert to a function. Code (expect_error(tidyr::pivot_longer(df, x, values_transform = list(~.x)))) diff --git a/tests/testthat/_snaps/verb-pivot-wider.md b/tests/testthat/_snaps/verb-pivot-wider.md index 713a06856..27958a192 100644 --- a/tests/testthat/_snaps/verb-pivot-wider.md +++ b/tests/testthat/_snaps/verb-pivot-wider.md @@ -60,7 +60,9 @@ --- - Can't convert to a function. + i In index: 2. + Caused by error in `dbplyr_pivot_wider_spec()`: + ! Can't convert to a function. # values_fn cannot be NULL @@ -76,7 +78,9 @@ (expect_error(tidyr::pivot_wider(df, id_cols = id, unused_fn = 1))) Output - Error in `dbplyr_pivot_wider_spec()`: + Error in `map2()`: + i In index: 1. + Caused by error in `dbplyr_pivot_wider_spec()`: ! Can't convert to a function. # can fill in missing cells