-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
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_aggopinSeriesandDataFrame - 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_aggopexist explicitly - Public API behavior remains unchanged
- Documentation and help() output list aggregation methods explicitly
- Static analysis tools correctly recognize aggregation methods
_make_aggophas no remaining callers
Metadata
Metadata
Assignees
Labels
No labels