Skip to content

Commit aab2291

Browse files
authored
Silence dask doctest warning (#8734)
* Silence dask doctest warning Closes #8732. Not the most elegant implementation but it's only temporary
1 parent 6187d80 commit aab2291

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ci/requirements/environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies:
99
- cartopy
1010
- cftime
1111
- dask-core
12+
- dask-expr # dask raises a deprecation warning without this, breaking doctests
1213
- distributed
1314
- flox
1415
- fsspec!=2021.7.0
@@ -32,7 +33,7 @@ dependencies:
3233
- pip
3334
- pooch
3435
- pre-commit
35-
- pyarrow # pandas makes a deprecation warning without this, breaking doctests
36+
- pyarrow # pandas raises a deprecation warning without this, breaking doctests
3637
- pydap
3738
- pytest
3839
- pytest-cov

conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ def add_standard_imports(doctest_namespace, tmpdir):
3939

4040
# always switch to the temporary directory, so files get written there
4141
tmpdir.chdir()
42+
43+
# Avoid the dask deprecation warning, can remove if CI passes without this.
44+
try:
45+
import dask
46+
except ImportError:
47+
pass
48+
else:
49+
dask.config.set({"dataframe.query-planning": True})

0 commit comments

Comments
 (0)