Skip to content

Commit

Permalink
Merge pull request #1058 from tidymodels/augment-message
Browse files Browse the repository at this point in the history
make missing eval_time error in augment more informative
  • Loading branch information
EmilHvitfeldt authored Jan 24, 2024
2 parents 5ba98ee + b04e0e7 commit 7c40966
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 7c40966

Please sign in to comment.