Skip to content

Commit 6347111

Browse files
don't bundle() unprepped steps (#56)
* don't `bundle()` unprepped steps * Remove extra `prep()` * Use ubuntu latest --------- Co-authored-by: Julia Silge <julia.silge@gmail.com>
1 parent 1498c88 commit 6347111

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/R-CMD-check-hard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
config:
27-
- {os: ubuntu-18.04, r: 'release'}
27+
- {os: ubuntu-latest, r: 'release'}
2828

2929
env:
3030
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# bundle (development version)
22

3+
* Fixed bundling of recipes steps situated inside of workflows.
4+
35
# bundle 0.1.0
46

57
* Initial CRAN release of package

R/bundle_workflows.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,12 @@ bundle.workflow <- function(x, ...) {
5252
rlang::check_dots_empty()
5353

5454
res <- swap_element(x, "fit", "fit")
55-
res <- swap_element(res, "pre", "actions", "recipe", "recipe")
5655
res <- swap_element(res, "pre", "mold", "blueprint", "recipe")
5756

5857
bundle_constr(
5958
object = res,
6059
situate = situate_constr(function(object) {
6160
res <- bundle::swap_element(object, "fit", "fit")
62-
res <- bundle::swap_element(res, "pre", "actions", "recipe", "recipe")
6361
res <- bundle::swap_element(res, "pre", "mold", "blueprint", "recipe")
6462

6563
structure(res, class = !!class(x))

tests/testthat/test_bundle_workflows.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ test_that("bundling + unbundling tidymodels workflows (lm + step_umap)", {
148148

149149
rec <-
150150
recipe(mpg ~ ., data = mtcars) %>%
151-
step_umap(all_predictors(), outcome = vars(mpg), num_comp = 2) %>%
152-
prep()
151+
step_umap(all_predictors(), outcome = vars(mpg), num_comp = 2)
153152

154153
mod <-
155154
workflow() %>%

0 commit comments

Comments
 (0)