()
| 5342 | |
| 5343 | |
| 5344 | def test_dataframe_into_delayed(): |
| 5345 | pdf = pd.DataFrame({"a": [1, 2, 3], "b": 1}) |
| 5346 | df = dd.from_pandas(pdf, npartitions=2) |
| 5347 | |
| 5348 | def test_func(df): |
| 5349 | return df.sum().sum() |
| 5350 | |
| 5351 | def delayed_func(i): |
| 5352 | # sanity check |
| 5353 | assert i.sum() == 6 |
| 5354 | |
| 5355 | df = df[["a"]].map_partitions(test_func, meta=(None, int)) |
| 5356 | result = delayed(delayed_func)(df) |
| 5357 | assert sum(map(len, result.dask.layers.values())) == 6 |
| 5358 | result.compute() |
| 5359 | |
| 5360 | |
| 5361 | def test_array_to_df_conversion(): |
nothing calls this directly
no test coverage detected