()
| 5347 | |
| 5348 | |
| 5349 | def test_from_xarray_string_conversion(): |
| 5350 | xr = pytest.importorskip("xarray") |
| 5351 | |
| 5352 | x = np.random.randn(10) |
| 5353 | y = np.arange(10, dtype="uint8") |
| 5354 | t = list("abcdefghij") |
| 5355 | ds = xr.Dataset( |
| 5356 | {"a": ("t", da.from_array(x, chunks=4)), "b": ("t", y), "t": ("t", t)} |
| 5357 | ) |
| 5358 | expected_pd = pd.DataFrame({"a": x, "b": y}, index=pd.Index(t, name="t")) |
| 5359 | expected = dd.from_pandas(expected_pd, chunksize=4) |
| 5360 | actual = ds.to_dask_dataframe(set_index=True) |
| 5361 | assert isinstance(actual, dd.DataFrame) |
| 5362 | pd.testing.assert_frame_equal(actual.compute(), expected.compute()) |
| 5363 | |
| 5364 | |
| 5365 | def test_dataframe_into_delayed(): |
nothing calls this directly
no test coverage detected