Skip to content

Commit 79ec616

Browse files
committed
everything is broken
1 parent 233e12e commit 79ec616

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

R/epi_recipe.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ add_epi_recipe <- function(
9595
#' @rdname add_epi_recipe
9696
#' @export
9797
remove_epi_recipe <- function(x) {
98-
workflows::remove_recipe(x)
98+
wf <- workflows::remove_recipe(x)
99+
class(wf) <- c("epi_workflow", class(wf))
100+
wf
99101
}
100102

101103

@@ -222,6 +224,7 @@ prep.epi_recipe <- function(
222224
if (!strings_as_factors) {
223225
return(NextMethod("prep"))
224226
}
227+
browser()
225228
# workaround to avoid converting strings2factors with recipes::prep.recipe()
226229
# We do the conversion here, then set it to FALSE
227230
training <- recipes:::check_training_set(training, x, fresh)

R/epi_workflow.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ fit.epi_workflow <- function(object, data, ..., control = workflows::control_wor
9696
as_of = attributes(data)$metadata$as_of
9797
)
9898
object$original_data <- data
99-
10099
NextMethod()
101100
}
102101

tests/testthat/test-epi_workflow.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ test_that("model can be added/updated/removed from epi_workflow", {
5959
expect_equal(class(model_spec2), c("linear_reg", "model_spec"))
6060

6161
wf <- remove_model(wf)
62+
expect_equal(class(wf), c("epi_workflow", "workflow"))
6263
expect_error(extract_spec_parsnip(wf))
6364
expect_equal(wf$fit$actions$model$spec, NULL)
6465
})

0 commit comments

Comments
 (0)