Skip to content

Commit 298d837

Browse files
committed
alter frosting test to avoid get_test_data bug
1 parent 30ddb54 commit 298d837

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

R/get_test_data.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ get_test_data <- function(recipe, x){
4949
.fns = ~ !is.na(.x)
5050
)
5151
) %>%
52-
dplyr::group_by(geo_value) %>%
53-
dplyr::slice_tail(n = max(max_lags) + 1)
52+
epiprocess::group_by(geo_value) %>%
53+
dplyr::slice_tail(n = max(max_lags) + 1) %>%
54+
epiprocess::ungroup()
5455

5556
return(test_data)
5657
}

tests/testthat/test-frosting.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test_that("prediction works without any postprocessor", {
2525
step_naomit(all_predictors()) %>%
2626
step_naomit(all_outcomes(), skip = TRUE)
2727
wf <- epi_workflow(r, linear_reg()) %>% fit(jhu)
28-
latest <- get_test_data(r, jhu)
28+
latest <- jhu %>% filter(time_value >= max(time_value) - 14)
2929

3030
expect_silent(predict(wf, latest))
3131
p <- predict(wf, latest) %>% dplyr::filter(!is.na(.pred))

0 commit comments

Comments
 (0)