From aab229118d80913a2fd38055ee0c8b096a229325 Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Sat, 10 Feb 2024 15:44:23 -0800 Subject: [PATCH] Silence dask doctest warning (#8734) * Silence dask doctest warning Closes #8732. Not the most elegant implementation but it's only temporary --- ci/requirements/environment.yml | 3 ++- conftest.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index f2304ce62ca..5e4259518b6 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -9,6 +9,7 @@ dependencies: - cartopy - cftime - dask-core + - dask-expr # dask raises a deprecation warning without this, breaking doctests - distributed - flox - fsspec!=2021.7.0 @@ -32,7 +33,7 @@ dependencies: - pip - pooch - pre-commit - - pyarrow # pandas makes a deprecation warning without this, breaking doctests + - pyarrow # pandas raises a deprecation warning without this, breaking doctests - pydap - pytest - pytest-cov diff --git a/conftest.py b/conftest.py index 862a1a1d0bc..24b7530b220 100644 --- a/conftest.py +++ b/conftest.py @@ -39,3 +39,11 @@ def add_standard_imports(doctest_namespace, tmpdir): # always switch to the temporary directory, so files get written there tmpdir.chdir() + + # Avoid the dask deprecation warning, can remove if CI passes without this. + try: + import dask + except ImportError: + pass + else: + dask.config.set({"dataframe.query-planning": True})