MCPcopy
hub / github.com/dask/dask / test_from_delayed_iterator

Function test_from_delayed_iterator

dask/bag/tests/test_bag.py:1232–1245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1230
1231
1232def test_from_delayed_iterator():
1233 from dask.delayed import delayed
1234
1235 def lazy_records(n):
1236 return ({"operations": [1, 2]} for _ in range(n))
1237
1238 delayed_records = delayed(lazy_records, pure=False)
1239 bag = db.from_delayed([delayed_records(5) for _ in range(5)])
1240 assert db.compute(
1241 bag.count(),
1242 bag.pluck("operations").count(),
1243 bag.pluck("operations").flatten().count(),
1244 scheduler="sync",
1245 ) == (25, 25, 50)
1246
1247
1248def test_range():

Callers

nothing calls this directly

Calls 6

delayedFunction · 0.90
from_delayedMethod · 0.80
pluckMethod · 0.80
flattenMethod · 0.80
computeMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…