MCPcopy
hub / github.com/dask/dask / test_dataframe_into_delayed

Function test_dataframe_into_delayed

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

Source from the content-addressed store, hash-verified

5324
5325
5326def test_dataframe_into_delayed():
5327 pdf = pd.DataFrame({"a": [1, 2, 3], "b": 1})
5328 df = dd.from_pandas(pdf, npartitions=2)
5329
5330 def test_func(df):
5331 return df.sum().sum()
5332
5333 def delayed_func(i):
5334 # sanity check
5335 assert i.sum() == 6
5336
5337 df = df[["a"]].map_partitions(test_func, meta=(None, int))
5338 result = delayed(delayed_func)(df)
5339 assert sum(map(len, result.dask.layers.values())) == 6
5340 result.compute()
5341
5342
5343def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…