Skip to content

Replace _make_aggop with Explicit Aggregation Method Definitions #5307

Closed

Description

@ajpotts

Summary

The internal helper _make_aggop is currently used to dynamically generate aggregation methods (e.g., sum, mean, max, min) on Series and DataFrame. This ticket proposes replacing that mechanism with explicit, statically defined aggregation methods.

Motivation

While _make_aggop reduces code repetition, it introduces several drawbacks:

  • Obscures the public API and makes available methods harder to discover
  • Complicates static analysis, type checking, and IDE support
  • Makes docstring generation and documentation consistency harder to maintain
  • Increases cognitive overhead when tracing behavior during debugging or review

Replacing dynamic method generation with explicit method definitions improves readability, tooling support, and long-term maintainability.

Scope

  • Remove or deprecate _make_aggop in Series and DataFrame
  • Implement explicit aggregation methods (e.g., sum, mean, max, min, prod, etc.)
  • Preserve existing behavior and signatures
  • Ensure docstrings are fully specified and Darglint/mypy compliant
  • Add or update tests to confirm behavioral parity

Non-Goals

  • Changing aggregation semantics or performance
  • Modifying the backend aggregation protocol
  • Introducing new aggregation operations

Acceptance Criteria

  • All aggregation methods previously generated by _make_aggop exist explicitly
  • Public API behavior remains unchanged
  • Documentation and help() output list aggregation methods explicitly
  • Static analysis tools correctly recognize aggregation methods
  • _make_aggop has no remaining callers

Activity

  1. self-assigned this
    on Jan 12, 2026
  2. changed the title [-]replace _make_aggop[/-] [+]Replace `_make_aggop` with Explicit Aggregation Method Definitions[/+] on Jan 12, 2026
  3. added a commit that references this issue on Jan 12, 2026
    e869a65
  4. removed their assignment
    on Feb 14, 2026
  5. self-assigned this
    on Mar 2, 2026
  6. added 5 commits that reference this issue on Mar 2, 2026
    fbfae90
    990da88
    b4787c7
    5d9a8e7
    ec1054d
  7. added a commit that references this issue on Mar 3, 2026
    908a0e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions