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

Function test_hash_split_unique

dask/dataframe/tests/test_dataframe.py:3992–4006  ·  view source on GitHub ↗
(npartitions, split_every, split_out)

Source from the content-addressed store, hash-verified

3990@pytest.mark.parametrize("split_every", [2, 5])
3991@pytest.mark.parametrize("split_out", [1, 5, 20])
3992def test_hash_split_unique(npartitions, split_every, split_out):
3993 from string import ascii_lowercase
3994
3995 s = pd.Series(np.random.choice(list(ascii_lowercase), 1000, replace=True))
3996 ds = dd.from_pandas(s, npartitions=npartitions)
3997
3998 dropped = ds.unique(split_every=split_every, split_out=split_out)
3999
4000 dsk = dropped.__dask_optimize__(dropped.dask, dropped.__dask_keys__())
4001 from dask.core import get_deps
4002
4003 dependencies, dependents = get_deps(dsk)
4004
4005 assert dropped.npartitions == (split_out or 1)
4006 assert sorted(dropped.compute(scheduler="sync")) == sorted(s.unique())
4007
4008
4009@pytest.mark.parametrize("split_every", [None, 2])

Callers

nothing calls this directly

Calls 6

uniqueMethod · 0.95
get_depsFunction · 0.90
__dask_optimize__Method · 0.80
choiceMethod · 0.45
__dask_keys__Method · 0.45
computeMethod · 0.45

Tested by

no test coverage detected