()
| 5324 | |
| 5325 | |
| 5326 | def 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 | |
| 5343 | def test_array_to_df_conversion(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…