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

Function test_sample_empty_partitions

dask/dataframe/tests/test_dataframe.py:4470–4479  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4468
4469
4470def test_sample_empty_partitions():
4471 @dask.delayed
4472 def make_df(n):
4473 return pd.DataFrame(np.zeros((n, 4)), columns=list("abcd"))
4474
4475 ddf = dd.from_delayed([make_df(0), make_df(100), make_df(0)])
4476 ddf2 = ddf.sample(frac=0.2)
4477 # smoke test sample on empty partitions
4478 res = ddf2.compute()
4479 assert res.dtypes.equals(ddf2.dtypes)
4480
4481
4482def test_coerce():

Callers

nothing calls this directly

Calls 4

make_dfFunction · 0.85
from_delayedMethod · 0.80
sampleMethod · 0.80
computeMethod · 0.45

Tested by

no test coverage detected