Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upErrors 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.
Many
bakemethods will either raise an error or return an empty dataset ifnewdatais a grouped data frame (classgrouped_dfas returned bydplyr::group_by). The reproducible example below provides a few examples. This appears to affect anybakemethod which uses the pattern,The problem occurs because when
newdatais"grouped_df"then this code will return a list rather than the expected data frame object.Replacing instances of
cbindwithdplyr::bind_colsseems 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: