Skip to content

Commit 4abfaea

Browse files
committed
CLN: remove unused args/kwargs (pandas-dev#36129)
1 parent 48b5847 commit 4abfaea

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pandas/core/groupby/generic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ def blk_func(bvalues: ArrayLike) -> ArrayLike:
11211121
assert how == "ohlc"
11221122
raise
11231123

1124+
# We get here with a) EADtypes and b) object dtype
11241125
obj: Union[Series, DataFrame]
11251126
# call our grouper again with only this block
11261127
if isinstance(bvalues, ExtensionArray):

pandas/core/groupby/groupby.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,8 @@ def _agg_general(
10121012
# raised in _get_cython_function, in some cases can
10131013
# be trimmed by implementing cython funcs for more dtypes
10141014
pass
1015+
else:
1016+
raise
10151017

10161018
# apply a non-cython aggregation
10171019
result = self.aggregate(lambda x: npfunc(x, axis=self.axis))

pandas/core/groupby/ops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def _transform(
608608

609609
return result
610610

611-
def agg_series(self, obj: Series, func: F, *args, **kwargs):
611+
def agg_series(self, obj: Series, func: F):
612612
# Caller is responsible for checking ngroups != 0
613613
assert self.ngroups != 0
614614

@@ -660,7 +660,7 @@ def _aggregate_series_fast(self, obj: Series, func: F):
660660
result, counts = grouper.get_result()
661661
return result, counts
662662

663-
def _aggregate_series_pure_python(self, obj: Series, func: F, *args, **kwargs):
663+
def _aggregate_series_pure_python(self, obj: Series, func: F):
664664
group_index, _, ngroups = self.group_info
665665

666666
counts = np.zeros(ngroups, dtype=int)
@@ -669,7 +669,7 @@ def _aggregate_series_pure_python(self, obj: Series, func: F, *args, **kwargs):
669669
splitter = get_splitter(obj, group_index, ngroups, axis=0)
670670

671671
for label, group in splitter:
672-
res = func(group, *args, **kwargs)
672+
res = func(group)
673673

674674
if result is None:
675675
if isinstance(res, (Series, Index, np.ndarray)):
@@ -846,7 +846,7 @@ def groupings(self) -> "List[grouper.Grouping]":
846846
for lvl, name in zip(self.levels, self.names)
847847
]
848848

849-
def agg_series(self, obj: Series, func: F, *args, **kwargs):
849+
def agg_series(self, obj: Series, func: F):
850850
# Caller is responsible for checking ngroups != 0
851851
assert self.ngroups != 0
852852
assert len(self.bins) > 0 # otherwise we'd get IndexError in get_result

0 commit comments

Comments
 (0)