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

Function test_hash_split_unique

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

Source from the content-addressed store, hash-verified

4011@pytest.mark.parametrize("split_every", [2, 5])
4012@pytest.mark.parametrize("split_out", [1, 5, 20])
4013def test_hash_split_unique(npartitions, split_every, split_out):
4014 from string import ascii_lowercase
4015
4016 s = pd.Series(np.random.choice(list(ascii_lowercase), 1000, replace=True))
4017 ds = dd.from_pandas(s, npartitions=npartitions)
4018
4019 dropped = ds.unique(split_every=split_every, split_out=split_out)
4020
4021 dsk = dropped.__dask_optimize__(dropped.dask, dropped.__dask_keys__())
4022 from dask.core import get_deps
4023
4024 dependencies, dependents = get_deps(dsk)
4025
4026 assert dropped.npartitions == (split_out or 1)
4027 assert sorted(dropped.compute(scheduler="sync")) == sorted(s.unique())
4028
4029
4030@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