Skip to content

Commit 018e73b

Browse files
committed
use cfg context
1 parent 464055f commit 018e73b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

modin/tests/pandas/test_groupby.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323
import modin.pandas as pd
2424
from modin.config import (
25-
DynamicPartitioning,
2625
IsRayCluster,
2726
NPartitions,
2827
RangePartitioning,
2928
StorageFormat,
29+
context,
3030
)
3131
from modin.core.dataframe.algebra.default2pandas.groupby import GroupBy
3232
from modin.core.dataframe.pandas.partitioning.axis_partition import (
@@ -2438,8 +2438,6 @@ def test_multi_column_groupby_different_partitions(
24382438

24392439

24402440
def test_empty_partitions_after_groupby():
2441-
DynamicPartitioning.put(True)
2442-
24432441
def func_to_apply(grp):
24442442
return grp.agg(
24452443
{
@@ -2452,15 +2450,16 @@ def func_to_apply(grp):
24522450
md_df, pd_df = create_test_dfs(data)
24532451
by = pd_df.columns[0]
24542452

2455-
md_grp, pd_grp = (
2456-
md_df.groupby(by),
2457-
pd_df.groupby(by),
2458-
)
2459-
eval_general(
2460-
md_grp,
2461-
pd_grp,
2462-
func_to_apply,
2463-
)
2453+
with context(DynamicPartitioning=True):
2454+
md_grp, pd_grp = (
2455+
md_df.groupby(by),
2456+
pd_df.groupby(by),
2457+
)
2458+
eval_general(
2459+
md_grp,
2460+
pd_grp,
2461+
func_to_apply,
2462+
)
24642463

24652464

24662465
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)