Skip to content
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

Fix upstream #7538

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dask/dataframe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6516,7 +6516,7 @@ def idxmaxmin_row(x, fn=None, skipna=True):


def idxmaxmin_combine(x, fn=None, skipna=True):
if len(x) == 0:
if len(x) <= 1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not getting to getting to this sooner. I think the len(x) == 0 case was to handle empty DataFrames. Do you know if our test suite covers the len(x) == 1 case? I'm somewhat surprised this works if we just pass a non-empty DataFrame through

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the tests that were failing, the issue was that in the agg step, len(x) was occasionally == 1. This happened when split_every=2 and the total number of partitions was 3, so sometimes there was only one item in x.

return x
return (
x.groupby(level=0)
Expand Down