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

Function test_dataframe_into_delayed

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

Source from the content-addressed store, hash-verified

5367
5368
5369def test_dataframe_into_delayed():
5370 pdf = pd.DataFrame({"a": [1, 2, 3], "b": 1})
5371 df = dd.from_pandas(pdf, npartitions=2)
5372
5373 def test_func(df):
5374 return df.sum().sum()
5375
5376 def delayed_func(i):
5377 # sanity check
5378 assert i.sum() == 6
5379
5380 df = df[["a"]].map_partitions(test_func, meta=(None, int))
5381 result = delayed(delayed_func)(df)
5382 assert sum(map(len, result.dask.layers.values())) == 6
5383 result.compute()
5384
5385
5386def 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