Test that comparison operations preserve dask backing.
()
| 554 | |
| 555 | @requires_dask |
| 556 | def test_eval_dask_comparison() -> None: |
| 557 | """Test that comparison operations preserve dask backing.""" |
| 558 | from xarray.core.utils import is_duck_dask_array |
| 559 | |
| 560 | ds = Dataset( |
| 561 | {"a": ("x", np.arange(10.0)), "b": ("x", np.arange(10.0)[::-1])} |
| 562 | ).chunk({"x": 5}) |
| 563 | |
| 564 | with raise_if_dask_computes(): |
| 565 | result = ds.eval("a > b") |
| 566 | |
| 567 | assert is_duck_dask_array(result.data) |
| 568 | |
| 569 | # Verify correctness |
| 570 | expected = ds["a"] > ds["b"] |
| 571 | assert_equal(result, expected) |
| 572 | |
| 573 | |
| 574 | @requires_dask |
nothing calls this directly
no test coverage detected
searching dependent graphs…