()
| 5308 | |
| 5309 | |
| 5310 | def test_from_xarray_string_conversion(): |
| 5311 | xr = pytest.importorskip("xarray") |
| 5312 | |
| 5313 | x = np.random.randn(10) |
| 5314 | y = np.arange(10, dtype="uint8") |
| 5315 | t = list("abcdefghij") |
| 5316 | ds = xr.Dataset( |
| 5317 | {"a": ("t", da.from_array(x, chunks=4)), "b": ("t", y), "t": ("t", t)} |
| 5318 | ) |
| 5319 | expected_pd = pd.DataFrame({"a": x, "b": y}, index=pd.Index(t, name="t")) |
| 5320 | expected = dd.from_pandas(expected_pd, chunksize=4) |
| 5321 | actual = ds.to_dask_dataframe(set_index=True) |
| 5322 | assert isinstance(actual, dd.DataFrame) |
| 5323 | pd.testing.assert_frame_equal(actual.compute(), expected.compute()) |
| 5324 | |
| 5325 | |
| 5326 | def test_dataframe_into_delayed(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…