()
| 5290 | |
| 5291 | |
| 5292 | def test_from_xarray(): |
| 5293 | xr = pytest.importorskip("xarray") |
| 5294 | |
| 5295 | a = da.zeros(shape=(6000, 45000), chunks=(30, 6000)) |
| 5296 | a = xr.DataArray( |
| 5297 | a, coords={"c1": list(range(6000)), "c2": list(range(45000))}, dims=["c1", "c2"] |
| 5298 | ) |
| 5299 | sel_coords = { |
| 5300 | "c1": pd.date_range("2024-11-01", "2024-11-10").to_numpy(), |
| 5301 | "c2": [29094], |
| 5302 | } |
| 5303 | |
| 5304 | result = a.reindex(**sel_coords).to_dask_dataframe() |
| 5305 | assert ( |
| 5306 | len(collections_to_expr([result]).optimize().__dask_graph__()) < 30 |
| 5307 | ) # previously 3000 |
| 5308 | |
| 5309 | |
| 5310 | def test_from_xarray_string_conversion(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…