Skip to content

Commit d962101

Browse files
committed
fix: purrr::partial missing future arg placement
Use `... =` to specify this. Prevents some confusing error messages on ``` archive_cases_dv_subset %>% epi_slide_opt(percent_cli, frollmean, 0, .window_size = 7) ``` but does not solve all issues that can happen with unnamed `...`.
1 parent 4aadc95 commit d962101

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

R/epi_slide_opt_archive.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ epi_slide_opt.epi_archive <-
107107
# debug stack traces:
108108
.f
109109
} else {
110-
purrr::partial(.f, ...)
110+
purrr::partial(.f, ... = , ...) # `... =` stands in for future args
111111
}
112112
col_names_quo <- enquo(.col_names)
113113
if (is.null(.window_size)) {

R/epi_slide_opt_edf.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ upstream_slide_f_info <- function(.f, ...) {
6262
}
6363
f_from_package <- f_info_row$package
6464
if (f_from_package == "data.table" && "fill" %in% names(rlang::call_match(dots_expand = FALSE)[["..."]])) {
65+
# XXX this doesn't detect with `fill` is passed positionally through dots...
6566
cli_abort("`epi_slide_opt` does not support `data.table::froll*()` with a
6667
custom `fill =` arg",
6768
class = "epiprocess__epi_slide_opt__fill_unsupported"
@@ -600,7 +601,7 @@ epi_slide_opt.epi_df <- function(.x, .col_names, .f, ...,
600601
# debug stack traces:
601602
.f
602603
} else {
603-
purrr::partial(.f, ...)
604+
purrr::partial(.f, ... = , ...) # `... =` stands in for future args
604605
}
605606

606607
result <- .x %>%

0 commit comments

Comments
 (0)