Skip to content

Commit b73489f

Browse files
authored
CLN: remove unused args/kwargs (#36129)
1 parent 6b2a860 commit b73489f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pandas/core/groupby/generic.py

+1
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ def blk_func(bvalues: ArrayLike) -> ArrayLike:
10841084
assert how == "ohlc"
10851085
raise
10861086

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

pandas/core/groupby/groupby.py

+2
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def _transform(
601601

602602
return result
603603

604-
def agg_series(self, obj: Series, func: F, *args, **kwargs):
604+
def agg_series(self, obj: Series, func: F):
605605
# Caller is responsible for checking ngroups != 0
606606
assert self.ngroups != 0
607607

@@ -649,7 +649,7 @@ def _aggregate_series_fast(self, obj: Series, func: F):
649649
result, counts = grouper.get_result()
650650
return result, counts
651651

652-
def _aggregate_series_pure_python(self, obj: Series, func: F, *args, **kwargs):
652+
def _aggregate_series_pure_python(self, obj: Series, func: F):
653653
group_index, _, ngroups = self.group_info
654654

655655
counts = np.zeros(ngroups, dtype=int)
@@ -658,7 +658,7 @@ def _aggregate_series_pure_python(self, obj: Series, func: F, *args, **kwargs):
658658
splitter = get_splitter(obj, group_index, ngroups, axis=0)
659659

660660
for label, group in splitter:
661-
res = func(group, *args, **kwargs)
661+
res = func(group)
662662

663663
if result is None:
664664
if isinstance(res, (Series, Index, np.ndarray)):
@@ -835,7 +835,7 @@ def groupings(self) -> "List[grouper.Grouping]":
835835
for lvl, name in zip(self.levels, self.names)
836836
]
837837

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

0 commit comments

Comments
 (0)