MCPcopy Create free account
hub / github.com/dask/dask / test_persist_array_bag

Function test_persist_array_bag

dask/tests/test_base.py:769–787  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

767
768@pytest.mark.skipif("not da")
769def test_persist_array_bag():
770 x = da.arange(5, chunks=2) + 1
771 b = db.from_sequence([1, 2, 3]).map(inc)
772
773 with pytest.raises(ValueError):
774 persist(x, b)
775
776 xx, bb = persist(x, b, scheduler="single-threaded")
777
778 assert isinstance(xx, da.Array)
779 assert isinstance(bb, db.Bag)
780
781 assert xx.name == x.name
782 assert bb.name == b.name
783 assert len(xx.dask) == xx.npartitions < len(x.dask)
784 assert len(bb.dask) == bb.npartitions < len(b.dask)
785
786 assert np.allclose(x, xx)
787 assert list(b) == list(bb)
788
789
790def test_persist_bag():

Callers

nothing calls this directly

Calls 3

persistFunction · 0.90
arangeMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected