Skip to content

Conversation

@etiennebacher
Copy link
Collaborator

@etiennebacher etiennebacher commented Nov 18, 2025

Part of #1397

Copilot AI review requested due to automatic review settings November 18, 2025 22:06
Copy link
Contributor

Copilot AI left a 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() and list_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

@etiennebacher etiennebacher marked this pull request as draft November 19, 2025 10:21
@etiennebacher etiennebacher marked this pull request as ready for review November 21, 2025 22:31
Copy link
Contributor

Copilot AI left a 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.

Copy link
Collaborator

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@etiennebacher etiennebacher merged commit d99cfaa into main Nov 22, 2025
32 checks passed
@etiennebacher etiennebacher deleted the list-arr-agg branch November 22, 2025 09:31
@eitsupi eitsupi added this to the 1.7.0 milestone Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants