()
| 5333 | |
| 5334 | |
| 5335 | def test_from_xarray(): |
| 5336 | xr = pytest.importorskip("xarray") |
| 5337 | |
| 5338 | a = da.zeros(shape=(6000, 45000), chunks=(30, 6000)) |
| 5339 | a = xr.DataArray( |
| 5340 | a, coords={"c1": list(range(6000)), "c2": list(range(45000))}, dims=["c1", "c2"] |
| 5341 | ) |
| 5342 | sel_coords = { |
| 5343 | "c1": pd.date_range("2024-11-01", "2024-11-10").to_numpy(), |
| 5344 | "c2": [29094], |
| 5345 | } |
| 5346 | |
| 5347 | result = a.reindex(**sel_coords).to_dask_dataframe() |
| 5348 | assert ( |
| 5349 | len(collections_to_expr([result]).optimize().__dask_graph__()) < 30 |
| 5350 | ) # previously 3000 |
| 5351 | |
| 5352 | |
| 5353 | def test_from_xarray_string_conversion(): |
nothing calls this directly
no test coverage detected