From 15c7c0f7f13c743165cf41892f28db0d623b7830 Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Fri, 8 Dec 2023 14:29:57 -0800 Subject: [PATCH] Don't trigger dask_graph call all the time --- dask/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dask/base.py b/dask/base.py index c015c4b7077..afdc7b18df2 100644 --- a/dask/base.py +++ b/dask/base.py @@ -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