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-#5925: Put a sorting-hack into groupby tests to hide #6875 bug #6896

Merged
merged 1 commit into from
Jan 30, 2024
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
10 changes: 5 additions & 5 deletions modin/pandas/test/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -3230,10 +3230,6 @@ def _apply_transform(df):
def test_range_groupby_categories(
observed, func, by_cols, cat_cols, exclude_values, as_index, modify_config
):
# HACK: there's a bug in range-partitioning impl that can be triggered
# here on certain seeds, manually setting the seed so it won't show up
# https://github.com/modin-project/modin/issues/6875
np.random.seed(0)
data = {
"a": ["a", "b", "c", "d", "e", "b", "g", "a"] * 32,
"b": [1, 2, 3, 4] * 64,
Expand All @@ -3248,4 +3244,8 @@ def test_range_groupby_categories(

md_res = func(md_df.groupby(by_cols, observed=observed, as_index=as_index))
pd_res = func(pd_df.groupby(by_cols, observed=observed, as_index=as_index))
df_equals(md_res, pd_res)

# HACK, FIXME: there's a bug in range-partitioning impl that apparently can
# break the order of rows in the result for multi-column groupbys. Placing the sorting-hack for now
# https://github.com/modin-project/modin/issues/6875
df_equals(md_res.sort_index(axis=0), pd_res.sort_index(axis=0))