Skip to content

Commit 5099f4c

Browse files
committed
add check_ordering=False
Signed-off-by: ryankert01 <[email protected]>
1 parent 0562105 commit 5099f4c

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

python/ray/data/tests/test_execution_optimizer_limit_pushdown.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,32 @@ def test_limit_pushdown_basic_limit_fusion(ray_start_regular_shared_2_cpus):
3838
"""Test basic Limit -> Limit fusion."""
3939
ds = ray.data.range(100).limit(5).limit(100)
4040
_check_valid_plan_and_result(
41-
ds, "Read[ReadRange] -> Limit[limit=5]", [{"id": i} for i in range(5)]
41+
ds,
42+
"Read[ReadRange] -> Limit[limit=5]",
43+
[{"id": i} for i in range(5)],
44+
check_ordering=False,
4245
)
4346

4447

4548
def test_limit_pushdown_limit_fusion_reversed(ray_start_regular_shared_2_cpus):
4649
"""Test Limit fusion with reversed order."""
4750
ds = ray.data.range(100).limit(100).limit(5)
4851
_check_valid_plan_and_result(
49-
ds, "Read[ReadRange] -> Limit[limit=5]", [{"id": i} for i in range(5)]
52+
ds,
53+
"Read[ReadRange] -> Limit[limit=5]",
54+
[{"id": i} for i in range(5)],
55+
check_ordering=False,
5056
)
5157

5258

5359
def test_limit_pushdown_multiple_limit_fusion(ray_start_regular_shared_2_cpus):
5460
"""Test multiple Limit operations fusion."""
5561
ds = ray.data.range(100).limit(50).limit(80).limit(5).limit(20)
5662
_check_valid_plan_and_result(
57-
ds, "Read[ReadRange] -> Limit[limit=5]", [{"id": i} for i in range(5)]
63+
ds,
64+
"Read[ReadRange] -> Limit[limit=5]",
65+
[{"id": i} for i in range(5)],
66+
check_ordering=False,
5867
)
5968

6069

@@ -66,7 +75,10 @@ def f1(x):
6675

6776
ds = ray.data.range(100, override_num_blocks=100).map(f1).limit(1)
6877
_check_valid_plan_and_result(
69-
ds, "Read[ReadRange] -> Limit[limit=1] -> MapRows[Map(f1)]", [{"id": 0}]
78+
ds,
79+
"Read[ReadRange] -> Limit[limit=1] -> MapRows[Map(f1)]",
80+
[{"id": 0}],
81+
check_ordering=False,
7082
)
7183

7284

@@ -81,6 +93,7 @@ def f2(x):
8193
ds,
8294
"Read[ReadRange] -> Limit[limit=1] -> MapBatches[MapBatches(f2)]",
8395
[{"id": 0}],
96+
check_ordering=False,
8497
)
8598

8699

@@ -92,7 +105,10 @@ def test_limit_pushdown_stops_at_filter(ray_start_regular_shared_2_cpus):
92105
.limit(1)
93106
)
94107
_check_valid_plan_and_result(
95-
ds, "Read[ReadRange] -> Filter[Filter(<lambda>)] -> Limit[limit=1]", [{"id": 0}]
108+
ds,
109+
"Read[ReadRange] -> Filter[Filter(<lambda>)] -> Limit[limit=1]",
110+
[{"id": 0}],
111+
check_ordering=False,
96112
)
97113

98114

@@ -149,6 +165,7 @@ def f2(x):
149165
ds,
150166
"Read[ReadRange] -> Limit[limit=1] -> MapRows[Map(f1)] -> MapRows[Map(f2)]",
151167
[{"id": 0}],
168+
check_ordering=False,
152169
)
153170

154171

0 commit comments

Comments
 (0)