Skip to content

Commit

Permalink
don't bundle() unprepped steps (#56)
Browse files Browse the repository at this point in the history
* don't `bundle()` unprepped steps

* Remove extra `prep()`

* Use ubuntu latest

---------

Co-authored-by: Julia Silge <[email protected]>
  • Loading branch information
simonpcouch and juliasilge authored Sep 6, 2023
1 parent 1498c88 commit 6347111
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-hard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# bundle (development version)

* Fixed bundling of recipes steps situated inside of workflows.

# bundle 0.1.0

* Initial CRAN release of package
2 changes: 0 additions & 2 deletions R/bundle_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ bundle.workflow <- function(x, ...) {
rlang::check_dots_empty()

res <- swap_element(x, "fit", "fit")
res <- swap_element(res, "pre", "actions", "recipe", "recipe")
res <- swap_element(res, "pre", "mold", "blueprint", "recipe")

bundle_constr(
object = res,
situate = situate_constr(function(object) {
res <- bundle::swap_element(object, "fit", "fit")
res <- bundle::swap_element(res, "pre", "actions", "recipe", "recipe")
res <- bundle::swap_element(res, "pre", "mold", "blueprint", "recipe")

structure(res, class = !!class(x))
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test_bundle_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ test_that("bundling + unbundling tidymodels workflows (lm + step_umap)", {

rec <-
recipe(mpg ~ ., data = mtcars) %>%
step_umap(all_predictors(), outcome = vars(mpg), num_comp = 2) %>%
prep()
step_umap(all_predictors(), outcome = vars(mpg), num_comp = 2)

mod <-
workflow() %>%
Expand Down

0 comments on commit 6347111

Please sign in to comment.