()
| 5308 | |
| 5309 | |
| 5310 | def test_from_xarray(): |
| 5311 | xr = pytest.importorskip("xarray") |
| 5312 | |
| 5313 | a = da.zeros(shape=(6000, 45000), chunks=(30, 6000)) |
| 5314 | a = xr.DataArray( |
| 5315 | a, coords={"c1": list(range(6000)), "c2": list(range(45000))}, dims=["c1", "c2"] |
| 5316 | ) |
| 5317 | sel_coords = { |
| 5318 | "c1": pd.date_range("2024-11-01", "2024-11-10").to_numpy(), |
| 5319 | "c2": [29094], |
| 5320 | } |
| 5321 | |
| 5322 | result = a.reindex(**sel_coords).to_dask_dataframe() |
| 5323 | assert ( |
| 5324 | len(collections_to_expr([result]).optimize().__dask_graph__()) < 30 |
| 5325 | ) # previously 3000 |
| 5326 | |
| 5327 | |
| 5328 | def test_from_xarray_string_conversion(): |
nothing calls this directly
no test coverage detected