-
Notifications
You must be signed in to change notification settings - Fork 111
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
Errors in many bake
methods when newdata
has class grouped_df
#125
Comments
Replace all cases of cbind with bind_cols. See issue tidymodels#125.
Replace all cases of cbind with bind_cols. See issue tidymodels#125.
Thanks for catching this. That does solve the issue. Fire away if you want to submit the PR otherwise I can commit my changes (but if you want the credit...) |
Will do. The changes are already in the linked commits. |
For Issue tidymodels#125. This is only one test, though the original bug affected multiple functions.
Opened PR #128 |
For Issue tidymodels#125. This is only one test, though the original bug affected multiple functions.
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. |
Many
bake
methods will either raise an error or return an empty dataset ifnewdata
is a grouped data frame (classgrouped_df
as returned bydplyr::group_by
). The reproducible example below provides a few examples. This appears to affect anybake
method which uses the pattern,The problem occurs because when
newdata
is"grouped_df"
then this code will return a list rather than the expected data frame object.Replacing instances of
cbind
withdplyr::bind_cols
seems to solve the problem - it passes all tests and produces the desired results. I could submit a pull request, but I haven't fully grokked recipes, and I don't know if grouped data frames have other implications for recipes. Should groupings be removed? Have special treatment?Minimal, runnable code:
Session Info:
The text was updated successfully, but these errors were encountered: