ARROW-8758: [R] Updates for compatibility with dplyr 1.0 #7147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tested this locally with the current version of
dplyr
on CRAN and the dev version scheduled to be released to CRAN on May 15. Our tests now pass with both versions.Changes addressed:
group_by
now requires a character vector of grouping variable names, so now we usegroup_vars()
instead ofgroups()
.group_vars()
works in the currentdplyr
release, so this is a simple change.group_by()
changed fromadd
to.add
, and calling it with the name that works in the current version raises a deprecation warning in dplyr 1.0. The fix here supports both spellings of the argument, and it avoids the warning by determining which version of the internal dplyr function exists and calling the appropriate one.dplyr::transmute()
no longer callsdplyr::mutate()
internally, so it doesn't just work on Arrow objects anymore. I skipped the one test that called it and left a TODO to add a transmute method.