()
| 5363 | |
| 5364 | |
| 5365 | def 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 | |
| 5382 | def test_array_to_df_conversion(): |
nothing calls this directly
no test coverage detected