Skip to content

Commit

Permalink
Don't trigger dask_graph call all the time
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Dec 8, 2023
1 parent d30b697 commit 15c7c0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dask/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ def is_dask_collection(x) -> bool:
"""
try:
return x.__dask_graph__() is not None
if "xarray" in type(x).__module__:
return x.__dask_graph__() is not None
else:
return hasattr(x, "__dask_graph__")

except (AttributeError, TypeError):
return False

Expand Down

0 comments on commit 15c7c0f

Please sign in to comment.