Skip to content

Commit

Permalink
make missing eval_time error in augment more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Jan 22, 2024
1 parent 07961a0 commit b04e0e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: parsnip
Title: A Common API to Modeling and Analysis Functions
Version: 1.1.1.9007
Version: 1.1.1.9008
Authors@R: c(
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
person("Davis", "Vaughan", , "[email protected]", role = "aut"),
Expand Down
8 changes: 6 additions & 2 deletions R/augment.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ augment_censored <- function(x, new_data, eval_time = NULL) {

if (spec_has_pred_type(x, "survival")) {
if (is.null(eval_time)) {
rlang::abort(
"The `eval_time` argument is missing, with no default.",
cli::cli_abort(
c(
x = "The {.arg eval_time} argument is missing, with no default.",
i = "{.arg eval_time} is required to be able to calculate \\
predictions of survival probability."
),
call = caller_env()
)
}
Expand Down

0 comments on commit b04e0e7

Please sign in to comment.