From fcdaa1e7dae7877d24162e3d66a2d090596910bc Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 19 Nov 2025 16:17:20 -0800 Subject: [PATCH 1/4] update strings_as_factors directly in recipe instead of through prep() --- R/blueprint-recipe-default.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/blueprint-recipe-default.R b/R/blueprint-recipe-default.R index b50728c8..f3c9899e 100644 --- a/R/blueprint-recipe-default.R +++ b/R/blueprint-recipe-default.R @@ -250,12 +250,13 @@ mold_recipe_default_process <- function( training <- NULL } + blueprint$recipe$strings_as_factors <- blueprint_strings_as_factors(blueprint) + # Prep for predictors and outcomes recipe <- recipes::prep( blueprint$recipe, training = training, - fresh = blueprint$fresh, - strings_as_factors = blueprint_strings_as_factors(blueprint) + fresh = blueprint$fresh ) blueprint <- update_blueprint0(blueprint, recipe = recipe) From c86fa4bf55887ace2cd3c2bafd1e4471a15fc62a Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 19 Nov 2025 16:17:27 -0800 Subject: [PATCH 2/4] update snapshots --- tests/testthat/_snaps/print.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/testthat/_snaps/print.md b/tests/testthat/_snaps/print.md index 2242bd85..aeedddc3 100644 --- a/tests/testthat/_snaps/print.md +++ b/tests/testthat/_snaps/print.md @@ -40,10 +40,6 @@ Code mold(recipes::recipe(Species ~ Sepal.Length, iris), iris)$blueprint - Condition - Warning: - The `strings_as_factors` argument of `prep.recipe()` is deprecated as of recipes 1.3.0. - i Please use the `strings_as_factors` argument of `recipe()` instead. Message Recipe blueprint: # Predictors: 1 From 0c26a15945137248d9d2c817291837630ae3e4ea Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 19 Nov 2025 16:17:43 -0800 Subject: [PATCH 3/4] bump suggested recipes version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ad3509cc..af4d2a13 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,7 +36,7 @@ Suggests: knitr, Matrix, modeldata (>= 0.0.2), - recipes (>= 1.0.5), + recipes (>= 1.3.0), rmarkdown (>= 2.3), roxygen2, testthat (>= 3.0.0), From 8dd9319e040cd52125fcb30f7d5fafa05980f173 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 19 Nov 2025 16:17:47 -0800 Subject: [PATCH 4/4] add news --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 6fc0422c..123681c7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # hardhat (development version) +* `mold()` no longer throws warnings about `strings_as_factors` argument when used on recipe objects (#284). + # hardhat 1.4.2 * Added `extract_tailor()` generic (#292).