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

Function test_dataframe_into_delayed

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

Source from the content-addressed store, hash-verified

5363
5364
5365def test_dataframe_into_delayed():
5366 pdf = pd.DataFrame({"a": [1, 2, 3], "b": 1})
5367 df = dd.from_pandas(pdf, npartitions=2)
5368
5369 def test_func(df):
5370 return df.sum().sum()
5371
5372 def delayed_func(i):
5373 # sanity check
5374 assert i.sum() == 6
5375
5376 df = df[["a"]].map_partitions(test_func, meta=(None, int))
5377 result = delayed(delayed_func)(df)
5378 assert sum(map(len, result.dask.layers.values())) == 6
5379 result.compute()
5380
5381
5382def test_array_to_df_conversion():

Callers

nothing calls this directly

Calls 5

delayedFunction · 0.90
sumFunction · 0.50
map_partitionsMethod · 0.45
valuesMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected