Skip to content

Commit

Permalink
Fix flaky test_dataframe_aggregations_multilevel (#9701)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed Dec 1, 2022
1 parent a7efdf9 commit f309f9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dask/dataframe/groupby.py
Expand Up @@ -532,7 +532,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 @@ -641,8 +643,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

0 comments on commit f309f9f

Please sign in to comment.