Skip to content

[R] Handle summarize() with 0 arguments or no aggregate functions #29195

Closed

Description

@asfimport

Following ARROW-13344, we should handle the case in which the user calls summarise() but does not call any aggregate functions in it.

Currently this is unhandled and results in errors (which are then are converted to warnings) like:

Warning: Error in x[c("fun", "options")] : object of type 'environment' is not subsettable ; pulling data into R

or when the expression in summarise() has only scalar literals:

Warning: Error : $ operator is invalid for atomic vectors
; pulling data into R 

or when there are zero arguments passed to summarise() and there is no group_by() preceding it:

Warning: Error : Invalid input type, expected 'character' actual 'NULL'
; pulling data into R 

We should aim for consistency with dplyr::summarise() in these cases, but if that's not practical then we should detect this case and throw a more informative error.

Reporter: Ian Cook / @ianmcook
Assignee: Neal Richardson / @nealrichardson

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-13543. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Aug 27, 2021

    @asfimport
    Author

    Ian Cook / @ianmcook:
    ARROW-13737 enables grouped aggregation on scalar columns, but that is different from this.

  2. asfimport commented on Sep 3, 2021

    @asfimport
    Author

    Neal Richardson / @nealrichardson:
    Issue resolved by pull request 11078
    #11078

  3. added this to the 6.0.0 milestone on Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions