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

Function test_sample_empty_partitions

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

Source from the content-addressed store, hash-verified

4443
4444
4445def test_sample_empty_partitions():
4446 @dask.delayed
4447 def make_df(n):
4448 return pd.DataFrame(np.zeros((n, 4)), columns=list("abcd"))
4449
4450 ddf = dd.from_delayed([make_df(0), make_df(100), make_df(0)])
4451 ddf2 = ddf.sample(frac=0.2)
4452 # smoke test sample on empty partitions
4453 res = ddf2.compute()
4454 assert res.dtypes.equals(ddf2.dtypes)
4455
4456
4457def 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