Skip to content

CLN: remove unused args/kwargs #36129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4c5eddd
REF: remove unnecesary try/except
jbrockmendel Aug 21, 2020
c632c9f
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Aug 21, 2020
9e64be3
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Aug 21, 2020
42649fb
TST: add test for agg on ordered categorical cols (#35630)
mathurk1 Aug 21, 2020
47121dd
TST: resample does not yield empty groups (#10603) (#35799)
tkmz-n Aug 21, 2020
1decb3e
revert accidental rebase
jbrockmendel Aug 22, 2020
57c5dd3
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 22, 2020
a358463
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 23, 2020
ffa7ad7
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 23, 2020
e5e98d4
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 24, 2020
408db5a
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 24, 2020
d3493cf
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 25, 2020
75a805a
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 25, 2020
9f61070
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 25, 2020
309cf47
REF: use BlockManager.apply for cython_agg_blocks, apply_blockwise
jbrockmendel Aug 26, 2020
7f67222
mypy fixup
jbrockmendel Aug 26, 2020
7298830
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Aug 26, 2020
5ac2d96
annotate align_keys
jbrockmendel Aug 26, 2020
e1f4b2c
dummy commit to force Travis
jbrockmendel Aug 27, 2020
5a4e9a5
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Aug 30, 2020
d9bad20
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Sep 4, 2020
06dc298
CLN: remove unused args/kwargs
jbrockmendel Sep 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ def blk_func(bvalues: ArrayLike) -> ArrayLike:
assert how == "ohlc"
raise

# We get here with a) EADtypes and b) object dtype
obj: Union[Series, DataFrame]
# call our grouper again with only this block
if isinstance(bvalues, ExtensionArray):
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,8 @@ def _agg_general(
# raised in _get_cython_function, in some cases can
# be trimmed by implementing cython funcs for more dtypes
pass
else:
raise

# apply a non-cython aggregation
result = self.aggregate(lambda x: npfunc(x, axis=self.axis))
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/groupby/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def _transform(

return result

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

Expand Down Expand Up @@ -649,7 +649,7 @@ def _aggregate_series_fast(self, obj: Series, func: F):
result, counts = grouper.get_result()
return result, counts

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

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

for label, group in splitter:
res = func(group, *args, **kwargs)
res = func(group)

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

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