-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Implement <expr>$arr$agg() and <expr>$list$agg()
#1655
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements <expr>$arr$agg() and <expr>$list$agg() methods, which run aggregation expressions against array/list elements and automatically explode the result when the expression returns a scalar. This is similar to the existing $eval() methods but with automatic scalar handling.
Key Changes:
- Added Rust implementations for
arr_agg()andlist_agg()that wrap the underlying Polars methods - Added R wrapper functions with comprehensive documentation and examples
- Added tests covering both scalar and non-scalar return value scenarios
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rust/src/expr/list.rs | Implements list_agg() method calling Polars' native list().agg() |
| src/rust/src/expr/array.rs | Implements arr_agg() method calling Polars' native arr().agg() |
| R/expr-list.R | Adds expr_list_agg() function with documentation and examples |
| R/expr-array.R | Adds expr_arr_agg() function with documentation and examples (contains documentation issues) |
| tests/testthat/test-expr-list.R | Tests for list$agg() covering scalar and non-scalar returns |
| tests/testthat/test-expr-array.R | Tests for arr$agg() covering scalar and non-scalar returns |
| R/000-wrappers.R | Auto-generated FFI wrappers for the new methods |
| src/init.c | Auto-generated C bindings registration |
| src/rust/api.h | Auto-generated FFI declarations |
| man/expr_list_agg.Rd | Generated documentation for list aggregation (contains minor dtype issue) |
| man/expr_arr_agg.Rd | Generated documentation for array aggregation (contains documentation issues) |
| altdoc/mkdocs.yml | Updated navigation to include new documentation pages |
| NEWS.md | Added changelog entry for the new feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
eitsupi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Part of #1397