You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recent merge of the new Collections protocol (#8674) broke Xarray's tests (pydata/xarray#6578)
Xarray objects return None from __dask_graph__ if there no dask arrays being wrapped.
It seems like the current version of is_dask_collection only checks for the presence of __dask_graph__. Xarray objects are a case where this check is not sufficient (they look like dask collections in general, you can call dask.visualize and dask.compute on xarray objects).
It isn't clear to me that there is a good solution other than explicitly checking the return value in is_dask_collection but if there is something we could do on the Xarray side, please let us know!
The text was updated successfully, but these errors were encountered:
Thanks for reporting @dcherian (and hooray for upstream CI testing 🎉 ). I've not had a chance to dig into this yet, but plan to do so tomorrow. cc'ing @douglasdavis@ian-r-rose in the meantime
Thanks for flagging this @dcherian! We had some discussion about exactly this change here, and were not aware of any downstream usages of returning None. At the time it seemed relatively safe since there are many places in dask's codebase that don't check for None and happily assume the result is a graph. But evidently not.
It's simple enough fix to roll back that change, though after we do it it might be nice if we could continue discussing how to tighten the protocol a bit.
The recent merge of the new Collections protocol (#8674) broke Xarray's tests (pydata/xarray#6578)
Xarray objects return None from
__dask_graph__
if there no dask arrays being wrapped.It seems like the current version of
is_dask_collection
only checks for the presence of__dask_graph__
. Xarray objects are a case where this check is not sufficient (they look like dask collections in general, you can calldask.visualize
anddask.compute
on xarray objects).It isn't clear to me that there is a good solution other than explicitly checking the return value in
is_dask_collection
but if there is something we could do on the Xarray side, please let us know!The text was updated successfully, but these errors were encountered: