Skip to content

Temporarily import loop_in_thread fixture from distributed #6884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion xarray/tests/test_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@

from dask.distributed import Client, Lock
from distributed.client import futures_of
from distributed.utils_test import cluster, gen_cluster, loop, cleanup # noqa: F401
from distributed.utils_test import ( # noqa: F401
cluster,
gen_cluster,
loop,
cleanup,
loop_in_thread,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only available in newer versions of distributed -- what's the minimum version of distributed xarray supports?

Copy link
Member

@andersy005 andersy005 Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we are now supporting distributed >= v2021.4: https://github.com/pydata/xarray/blob/main/ci/requirements/min-all-deps.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andersy005! Actually looking at it more closely, it looks like loop_in_thread has been around for a long time but the need to actually import it is new. So the changes here should both fix the failures we're seeing and also be backwards compatible. It also looks like there's a CI build which tests against the minimum supported version of packages (including distributed)

- env: "min-all-deps"
python-version: "3.8"
os: ubuntu-latest

which is also passing

)

import xarray as xr
from xarray.backends.locks import HDF5_LOCK, CombinedLock
Expand Down