MCPcopy
hub / github.com/ray-project/ray / test_zip_e2e

Function test_zip_e2e

python/ray/data/tests/test_execution_optimizer_advanced.py:404–419  ·  view source on GitHub ↗
(
    ray_start_regular_shared_2_cpus, num_blocks1, num_blocks2, num_blocks3
)

Source from the content-addressed store, hash-verified

402 list(itertools.combinations_with_replacement(range(1, 4), 3)),
403)
404def test_zip_e2e(
405 ray_start_regular_shared_2_cpus, num_blocks1, num_blocks2, num_blocks3
406):
407 n = 4
408 ds1 = ray.data.range(n, override_num_blocks=num_blocks1)
409 ds2 = ray.data.range(n, override_num_blocks=num_blocks2).map(
410 column_udf("id", lambda x: x + 1)
411 )
412 ds3 = ray.data.range(n, override_num_blocks=num_blocks3).map(
413 column_udf("id", lambda x: x + 2)
414 )
415 ds = ds1.zip(ds2, ds3)
416 assert ds.take() == named_values(
417 ["id", "id_1", "id_2"], zip(range(n), range(1, n + 1), range(2, n + 2))
418 )
419 _check_usage_record(["ReadRange", "Zip"])
420
421
422def test_execute_to_legacy_block_list(

Callers

nothing calls this directly

Calls 7

column_udfFunction · 0.90
named_valuesFunction · 0.90
_check_usage_recordFunction · 0.90
rangeFunction · 0.70
mapMethod · 0.45
zipMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…