Skip to content

Commit

Permalink
remove dask-expr from CI runs, fix related tests (#9971)
Browse files Browse the repository at this point in the history
* remove dask-expr from CI runs, fix related tests

* Explicitely add pyarrow to windows builds, as importing dask.dataframe (dask>=2025.1.0) raises ImportError when missing.

* add whats-new.rst entry
  • Loading branch information
kmuehlbauer authored Jan 22, 2025
1 parent 4ccb048 commit f2e9f86
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion ci/requirements/all-but-numba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- cartopy
- cftime
- dask-core
- dask-expr # dask raises a deprecation warning without this, breaking doctests
- distributed
- flox
- fsspec
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- cfgrib
- kerchunk
- dask-core>=2022.1
- dask-expr
- hypothesis>=6.75.8
- h5netcdf>=0.13
- ipykernel
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/environment-3.13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- cartopy
- cftime
- dask-core
- dask-expr
- distributed
- flox
- fsspec
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/environment-windows-3.13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
- cartopy
- cftime
- dask-core
- dask-expr
- distributed
- flox
- fsspec
Expand All @@ -29,6 +28,7 @@ dependencies:
# - pint>=0.22
- pip
- pre-commit
- pyarrow # importing dask.dataframe raises an ImportError without this
- pydap
- pytest
- pytest-cov
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/environment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
- cartopy
- cftime
- dask-core
- dask-expr
- distributed
- flox
- fsspec
Expand All @@ -29,6 +28,7 @@ dependencies:
# - pint>=0.22
- pip
- pre-commit
- pyarrow # importing dask.dataframe raises an ImportError without this
- pydap
- pytest
- pytest-cov
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- cartopy
- cftime
- dask-core
- dask-expr # dask raises a deprecation warning without this, breaking doctests
- distributed
- flox
- fsspec
Expand Down
3 changes: 2 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ Bug fixes
~~~~~~~~~
- Fix issues related to Pandas v3 ("us" vs. "ns" for python datetime, copy on write) and handling of 0d-numpy arrays in datetime/timedelta decoding (:pull:`9953`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.

- Remove dask-expr from CI runs, add "pyarrow" dask dependency to windows CI runs, fix related tests (:issue:`9962`, :pull:`9971`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.

Documentation
~~~~~~~~~~~~~
Expand Down
19 changes: 12 additions & 7 deletions xarray/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,18 @@ def _importorskip(
"dask", minversion="2024.08.1"
)
has_dask_ge_2024_11_0, requires_dask_ge_2024_11_0 = _importorskip("dask", "2024.11.0")
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
message="The current Dask DataFrame implementation is deprecated.",
category=DeprecationWarning,
)
has_dask_expr, requires_dask_expr = _importorskip("dask_expr")
has_dask_ge_2025_1_0, requires_dask_ge_2025_1_0 = _importorskip("dask", "2025.1.0")
if has_dask_ge_2025_1_0:
has_dask_expr = True
requires_dask_expr = pytest.mark.skipif(not has_dask_expr, reason="should not skip")
else:
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
message="The current Dask DataFrame implementation is deprecated.",
category=DeprecationWarning,
)
has_dask_expr, requires_dask_expr = _importorskip("dask_expr")
has_bottleneck, requires_bottleneck = _importorskip("bottleneck")
has_rasterio, requires_rasterio = _importorskip("rasterio")
has_zarr, requires_zarr = _importorskip("zarr")
Expand Down
3 changes: 2 additions & 1 deletion xarray/tests/test_dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
assert_identical,
assert_no_warnings,
has_dask,
has_dask_ge_2025_1_0,
raise_if_dask_computes,
requires_bottleneck,
requires_cupy,
Expand Down Expand Up @@ -3437,7 +3438,7 @@ def test_to_dataframe_0length(self) -> None:

@requires_dask_expr
@requires_dask
@pytest.mark.xfail(reason="dask-expr is broken")
@pytest.mark.xfail(not has_dask_ge_2025_1_0, reason="dask-expr is broken")
def test_to_dask_dataframe(self) -> None:
arr_np = np.arange(3 * 4).reshape(3, 4)
arr = DataArray(arr_np, [("B", [1, 2, 3]), ("A", list("cdef"))], name="foo")
Expand Down

0 comments on commit f2e9f86

Please sign in to comment.