Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidy.recipe() throws error for zero-step recipes #867

Closed
EmilHvitfeldt opened this issue Dec 13, 2021 · 1 comment · Fixed by #868
Closed

tidy.recipe() throws error for zero-step recipes #867

EmilHvitfeldt opened this issue Dec 13, 2021 · 1 comment · Fixed by #868
Labels
bug an unexpected problem or unintended behavior

Comments

@EmilHvitfeldt
Copy link
Member

tidy.recipe() should return a zero row tibble for empty recipes instead of throwing an error. This is making step_detect() error when used on empty recipes.

library(recipes)

recipe(~., data = mtcars) %>%
  step_center(all_predictors()) %>%
  tidy()
#> # A tibble: 1 × 6
#>   number operation type   trained skip  id          
#>    <int> <chr>     <chr>  <lgl>   <lgl> <chr>       
#> 1      1 step      center FALSE   FALSE center_uXNNk

recipe(~., data = mtcars) %>%
  tidy()
#> Error: No steps in recipe.
@EmilHvitfeldt EmilHvitfeldt added the bug an unexpected problem or unintended behavior label Dec 13, 2021
@github-actions
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant