diff --git a/.github/workflows/R-CMD-check-dev-recipes.yaml b/.github/workflows/R-CMD-check-dev-recipes.yaml deleted file mode 100644 index 335ba208..00000000 --- a/.github/workflows/R-CMD-check-dev-recipes.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# NOTE: Used to check against dev recipes until recipes 1.0.0 is released. -# Needed to ensure that hardhat's special recipes 1.0.0 -# `update_role_requirements()` support has correct behavior in pre and post -# recipes 1.0.0. After recipes 1.0.0 is release, we can: -# - Remove this workflow -# - Remove `skip_if_no_update_role_requirements()` -# - Remove `@examplesIf` in `default_recipe_blueprint()` docs -# - Put `recipes (>= 1.0.0)` in Suggests - -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. -# usethis::use_github_action("check-standard") will install it. -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check-dev-recipes - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck, tidymodels/recipes - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true diff --git a/DESCRIPTION b/DESCRIPTION index 12ca1e13..1a1f0886 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,7 +32,7 @@ Suggests: knitr, Matrix, modeldata (>= 0.0.2), - recipes (>= 0.1.8), + recipes (>= 1.0.0), rmarkdown (>= 2.3), roxygen2, testthat (>= 3.0.0), diff --git a/R/blueprint-recipe-default.R b/R/blueprint-recipe-default.R index 7aa9a3a3..b4f8531b 100644 --- a/R/blueprint-recipe-default.R +++ b/R/blueprint-recipe-default.R @@ -100,7 +100,6 @@ #' processed <- mold(rec, train, blueprint = bp) #' class(processed$predictors) #' -#' @examplesIf utils::packageVersion("recipes") >= "0.2.0.9002" #' # --------------------------------------------------------------------------- #' # Non standard roles #' diff --git a/man/default_recipe_blueprint.Rd b/man/default_recipe_blueprint.Rd index f18cc26c..69cff4cd 100644 --- a/man/default_recipe_blueprint.Rd +++ b/man/default_recipe_blueprint.Rd @@ -129,7 +129,6 @@ bp <- default_recipe_blueprint(composition = "dgCMatrix") processed <- mold(rec, train, blueprint = bp) class(processed$predictors) -\dontshow{if (utils::packageVersion("recipes") >= "0.2.0.9002") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # --------------------------------------------------------------------------- # Non standard roles @@ -166,5 +165,4 @@ try(forge(test2, processed_roles$blueprint)) rec_roles <- update_role_requirements(rec_roles, "important", bake = FALSE) processed_roles <- mold(rec_roles, train) forge(test2, processed_roles$blueprint) -\dontshow{\}) # examplesIf} } diff --git a/tests/testthat/helper-recipes.R b/tests/testthat/helper-recipes.R deleted file mode 100644 index d7c20a92..00000000 --- a/tests/testthat/helper-recipes.R +++ /dev/null @@ -1,6 +0,0 @@ -skip_if_no_update_role_requirements <- function() { - skip_if( - condition = utils::packageVersion("recipes") < "0.2.0.9002", - "Doesn't have `recipes::update_role_requirements()`" - ) -} diff --git a/tests/testthat/test-forge-recipe.R b/tests/testthat/test-forge-recipe.R index c8dac418..ac464969 100644 --- a/tests/testthat/test-forge-recipe.R +++ b/tests/testthat/test-forge-recipe.R @@ -483,8 +483,6 @@ test_that("non-standard roles generated in the recipe are returned by both `mold }) test_that("`forge()` returns a slot for non standard roles that aren't required at `bake()` time", { - skip_if_no_update_role_requirements() - # This is a convention we follow to have consistency between `mold()` and `forge()`. # Both should have the same `.$extras$roles$` slot names, even if there # wasn't any data there at `forge()` time (because it wasn't a required role). @@ -567,8 +565,6 @@ test_that("`forge()` will error if required non standard roles are missing", { }) test_that("recipes will error if the role is declared as not required, but really was", { - skip_if_no_update_role_requirements() - rec <- recipes::recipe(Species ~ ., iris) rec <- recipes::update_role(rec, Sepal.Width, new_role = "dummy1") rec <- recipes::update_role_requirements(rec, "dummy1", bake = FALSE) @@ -605,8 +601,6 @@ test_that("`NA` roles are treated as extra roles that are required at `forge()` }) test_that("`NA` roles can be declared as not required at `forge()` time", { - skip_if_no_update_role_requirements() - # Petal.Length, Petal.Width have `NA` roles rec <- recipes::recipe(iris) rec <- recipes::update_role(rec, Sepal.Length, new_role = "predictor") diff --git a/tests/testthat/test-mold-recipe.R b/tests/testthat/test-mold-recipe.R index 7841ace5..9cc737ce 100644 --- a/tests/testthat/test-mold-recipe.R +++ b/tests/testthat/test-mold-recipe.R @@ -151,9 +151,6 @@ test_that("non-standard roles ptypes are stored by default", { }) test_that("case weights is not considered a required extra role by default", { - # If we have this, we also have case weight support - skip_if_no_update_role_requirements() - iris$weight <- frequency_weights(seq_len(nrow(iris))) rec <- recipes::recipe(Species ~ ., iris) @@ -177,8 +174,6 @@ test_that("case weights is not considered a required extra role by default", { }) test_that("case weights can be updated to be a required extra role", { - skip_if_no_update_role_requirements() - iris$weight <- frequency_weights(seq_len(nrow(iris))) rec <- recipes::recipe(Species ~ ., iris) @@ -368,8 +363,6 @@ test_that("`NA` roles are treated as extra roles", { }) test_that("roles that aren't required are not retained as `extra_role_ptypes`, but are in the mold result", { - skip_if_no_update_role_requirements() - rec <- recipes::recipe(Species ~ ., iris) rec <- recipes::update_role(rec, Sepal.Width, new_role = "dummy1") rec <- recipes::update_role(rec, Sepal.Length, new_role = "dummy2")