Skip to content

fix: Raise error instead of panic for unsupported pivot aggregate#26863

Open
RenzoMXD wants to merge 1 commit intopola-rs:mainfrom
RenzoMXD:fix/pivot-panic-unsupported-agg-25860
Open

fix: Raise error instead of panic for unsupported pivot aggregate#26863
RenzoMXD wants to merge 1 commit intopola-rs:mainfrom
RenzoMXD:fix/pivot-panic-unsupported-agg-25860

Conversation

@RenzoMXD
Copy link
Contributor

@RenzoMXD RenzoMXD commented Mar 9, 2026

The panic was caused by .expect() in IRBuilder::group_by() (builder_ir.rs:303) when schema derivation failed for an unsupported aggregate expression. Changed group_by() to return PolarsResult<Self> so the error propagates as an InvalidOperationError instead of panicking.

Closes #25860
Closes #26843

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars title needs formatting labels Mar 9, 2026
@RenzoMXD RenzoMXD changed the title fix: raise error instead of panic for unsupported pivot aggregate (#2… fix: raise error instead of panic for unsupported pivot aggregate Mar 9, 2026
@RenzoMXD RenzoMXD changed the title fix: raise error instead of panic for unsupported pivot aggregate fix: Raise error instead of panic for unsupported pivot aggregate Mar 9, 2026
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.65%. Comparing base (9d60226) to head (d34c594).

Files with missing lines Patch % Lines
...rc/plans/optimizer/projection_pushdown/group_by.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26863      +/-   ##
==========================================
+ Coverage   81.00%   81.65%   +0.65%     
==========================================
  Files        1805     1805              
  Lines      248021   248020       -1     
  Branches     3132     3132              
==========================================
+ Hits       200902   202530    +1628     
+ Misses      46313    44684    -1629     
  Partials      806      806              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pivot panic regression with fill_null as an aggregate_function= pivot PanicException if datatype does not support aggregate_function

1 participant