From e4ee075669d8810e506f43ddcc4e35e55548cbc5 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 25 Oct 2024 08:56:47 -0700 Subject: [PATCH] clarify step_date() error for wrong features --- R/date.R | 3 +-- tests/testthat/_snaps/date.md | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/R/date.R b/R/date.R index 5dbdeabe2..5bdb45fd5 100644 --- a/R/date.R +++ b/R/date.R @@ -111,8 +111,7 @@ step_date <- offenders <- features[!features %in% feat] cli::cli_abort(c( - x = "Possible values of {.arg features} should include:", - "*" = "{.or {.val {feat}}}.", + x = "Possible values of {.arg features} are {.or {.val {feat}}}.", i = "Invalid values were: {.val {offenders}}." )) } diff --git a/tests/testthat/_snaps/date.md b/tests/testthat/_snaps/date.md index b9535af21..db44e6cd4 100644 --- a/tests/testthat/_snaps/date.md +++ b/tests/testthat/_snaps/date.md @@ -15,8 +15,7 @@ prep() Condition Error in `step_date()`: - x Possible values of `features` should include: - * "year", "doy", "mday", "week", "decimal", "semester", "quarter", "dow", or "month". + x Possible values of `features` are "year", "doy", "mday", "week", "decimal", "semester", "quarter", "dow", or "month". i Invalid values were: "yearly". --- @@ -26,8 +25,7 @@ "daily", "monthly", "yearly")) %>% prep() Condition Error in `step_date()`: - x Possible values of `features` should include: - * "year", "doy", "mday", "week", "decimal", "semester", "quarter", "dow", or "month". + x Possible values of `features` are "year", "doy", "mday", "week", "decimal", "semester", "quarter", "dow", or "month". i Invalid values were: "daily", "monthly", and "yearly". --- @@ -37,8 +35,7 @@ "daily", "month", "yearly")) %>% prep() Condition Error in `step_date()`: - x Possible values of `features` should include: - * "year", "doy", "mday", "week", "decimal", "semester", "quarter", "dow", or "month". + x Possible values of `features` are "year", "doy", "mday", "week", "decimal", "semester", "quarter", "dow", or "month". i Invalid values were: "daily" and "yearly". # bake method errors when needed non-standard role columns are missing