Skip to content

[Python] Keep count/size labels in DataFrame agg with a list - #40506

Merged
damccorm merged 1 commit into
apache:masterfrom
anishmehta24:fix/agg-count-label
Oct 12, 2026
Merged

damccorm merged 1 commit into
apache:masterfrom
anishmehta24:fix/agg-count-label

Conversation

@anishmehta24

Copy link
Copy Markdown
Contributor

Fixes #40504

agg with a list combines the per-partition count/size results with s.agg(['sum']), so the row came back labelled sum. This combines them with {base_func: 'sum'} instead, which keeps the count/size label. Added a test to frames_test.py and a CHANGES.md entry.

Written with help from Claude.

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.24%. Comparing base (76f6e6d) to head (93827f0).
⚠️ Report is 111 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #40506      +/-   ##
============================================
+ Coverage     56.16%   56.24%   +0.07%     
  Complexity     2288     2288              
============================================
  Files          1124     1124              
  Lines        178336   178361      +25     
  Branches       1489     1489              
============================================
+ Hits         100170   100316     +146     
+ Misses        75645    75524     -121     
  Partials       2521     2521              
Flag Coverage Δ
python 79.70% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@damccorm damccorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@damccorm
damccorm merged commit 3486966 into apache:master Oct 12, 2026
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DataFrame API agg(['count', ...]) labels the count/size row as 'sum'

2 participants