From b04e0e702f63a2e7ac33fd535a2fe8bfe95012bd Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Mon, 22 Jan 2024 11:10:50 -0800 Subject: [PATCH] make missing eval_time error in augment more informative --- DESCRIPTION | 2 +- R/augment.R | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d7ca644f7..268b8fcad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", , "max@posit.co", role = c("aut", "cre")), person("Davis", "Vaughan", , "davis@posit.co", role = "aut"), diff --git a/R/augment.R b/R/augment.R index 6e55055a6..7ecea0d6f 100644 --- a/R/augment.R +++ b/R/augment.R @@ -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() ) }