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 flaky test_dataframe_aggregations_multilevel #9701

Merged
merged 4 commits into from Dec 1, 2022
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
8 changes: 6 additions & 2 deletions dask/dataframe/groupby.py
Expand Up @@ -531,7 +531,9 @@ def _mul_cols(df, cols):
# Fix index in a groupby().apply() context
# https://github.com/dask/dask/issues/8137
# https://github.com/pandas-dev/pandas/issues/43568
_df.index = [0] * len(_df)
# Make sure index dtype is int (even if _df is empty)
# https://github.com/dask/dask/pull/9701
_df.index = np.zeros(len(_df), dtype=int)
return _df


Expand Down Expand Up @@ -640,8 +642,10 @@ def _drop_duplicates_reindex(df):
# Fix index in a groupby().apply() context
# https://github.com/dask/dask/issues/8137
# https://github.com/pandas-dev/pandas/issues/43568
# Make sure index dtype is int (even if result is empty)
# https://github.com/dask/dask/pull/9701
result = df.drop_duplicates()
result.index = [0] * len(result)
result.index = np.zeros(len(result), dtype=int)
return result


Expand Down