Commits


eitsupi authored and GitHub committed 29cc263068b
ARROW-17085: [R] group_vars() should not return NULL (#13621) If an ungrouped data.frame or an `arrow_dplyr_query` is given to `dplyr::group_vars()`, `character()` returns. But for an ungrouped Table, `NULL` is returned. ```r mtcars |> dplyr::group_vars() #> character(0) mtcars |> arrow:::as_adq() |> dplyr::group_vars() #> character(0) mtcars |> arrow::arrow_table() |> dplyr::group_vars() #> NULL ``` Therefore, functions that expect `group_vars` to return character, such as the following, will fail. ```r mtcars |> arrow::arrow_table() |> dtplyr::lazy_dt() #> Error in new_step(parent, vars = names(parent), groups = groups, locals = list(), : is.character(groups) is not TRUE ``` This PR modifies `dplyr::group_vars()` and `dplyr::groups()` for Arrow objects to work the same as for data.frame. (Note that `arrow_dplyr_query` already works the same way as data.frame.) Lead-authored-by: SHIMA Tatsuya <ts1s1andn@gmail.com> Co-authored-by: eitsupi <50911393+eitsupi@users.noreply.github.com> Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>