html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/pull/6940#issuecomment-1242718333,https://api.github.com/repos/pydata/xarray/issues/6940,1242718333,IC_kwDOAMm_X85KEmB9,6628425,2022-09-10T12:28:16Z,2022-09-10T12:28:16Z,MEMBER,Oops sorry I missed the merge conflict. Thanks @dcherian and @mathause.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1345573285 https://github.com/pydata/xarray/pull/6940#issuecomment-1222691662,https://api.github.com/repos/pydata/xarray/issues/6940,1222691662,IC_kwDOAMm_X85I4MtO,6628425,2022-08-22T17:38:22Z,2022-08-22T17:38:22Z,MEMBER,"> It looks like we can bump to 2021.08.0 instead of dealing with this compatibility code. Thanks for noting this @dcherian. I wasn't sure if this was worth bumping our minimum version for, but since our policy allows for it, I'm happy to make that change.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1345573285 https://github.com/pydata/xarray/pull/6940#issuecomment-1222558754,https://api.github.com/repos/pydata/xarray/issues/6940,1222558754,IC_kwDOAMm_X85I3sQi,2448579,2022-08-22T15:58:42Z,2022-08-22T15:58:42Z,MEMBER,"Thanks @spencerkclark ``` dask-core 2021.4 (2021-04-02) 2021.8 (2021-08-13) < distributed 2021.4 (2021-04-02) 2021.8 (2021-08-14) < ``` It looks like we can bump to 2021.08.0 instead of dealing with this compatibility code. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1345573285 https://github.com/pydata/xarray/pull/6940#issuecomment-1221642349,https://api.github.com/repos/pydata/xarray/issues/6940,1221642349,IC_kwDOAMm_X85I0Mht,6628425,2022-08-21T23:24:06Z,2022-08-21T23:24:06Z,MEMBER,"Ah, this still didn't quite work for older dask versions:

``` ====================================================================================================== FAILURES ======================================================================================================= ___________________________________________________________________________________________ test_cftime_datetime_mean[True] ___________________________________________________________________________________________ dask = True @requires_cftime @pytest.mark.parametrize(""dask"", [False, True]) def test_cftime_datetime_mean(dask): if dask and not has_dask: pytest.skip(""requires dask"") times = cftime_range(""2000"", periods=4) da = DataArray(times, dims=[""time""]) da_2d = DataArray(times.values.reshape(2, 2)) if dask: da = da.chunk({""time"": 2}) da_2d = da_2d.chunk({""dim_0"": 2}) expected = da.isel(time=0) # one compute needed to check the array contains cftime datetimes with raise_if_dask_computes(max_computes=1): > result = da.isel(time=0).mean() /Users/spencer/software/xarray/xarray/tests/test_duck_array_ops.py:342: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /Users/spencer/software/xarray/xarray/core/_reductions.py:1478: in mean return self.reduce( /Users/spencer/software/xarray/xarray/core/dataarray.py:2930: in reduce var = self.variable.reduce(func, dim, axis, keep_attrs, keepdims, **kwargs) /Users/spencer/software/xarray/xarray/core/variable.py:1854: in reduce data = func(self.data, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ array = dask.array, axis = None, skipna = None, kwargs = {} _contains_cftime_datetimes = , offset = dask.array timedeltas = dask.array, mean_timedeltas = dask.array def mean(array, axis=None, skipna=None, **kwargs): """"""inhouse mean that can handle np.datetime64 or cftime.datetime dtypes"""""" from .common import _contains_cftime_datetimes array = asarray(array) if array.dtype.kind in ""Mm"": offset = _datetime_nanmin(array) # xarray always uses np.datetime64[ns] for np.datetime64 data dtype = ""timedelta64[ns]"" return ( _mean( datetime_to_numeric(array, offset), axis=axis, skipna=skipna, **kwargs ).astype(dtype) + offset ) elif _contains_cftime_datetimes(array): offset = min(array) timedeltas = datetime_to_numeric(array, offset, datetime_unit=""us"") mean_timedeltas = _mean(timedeltas, axis=axis, skipna=skipna, **kwargs) > return _to_pytimedelta(mean_timedeltas, unit=""us"") + offset E TypeError: unsupported operand type(s) for +: 'Array' and 'Array' /Users/spencer/software/xarray/xarray/core/duck_array_ops.py:573: TypeError ```

This appears to be the commit that fixed this issue in dask, meaning it should be fixed as of dask version 2021.07.0: ``` git bisect broken 626cc724ffa1d14cd74f48ff4f21ef443d832afa is the first fixed commit commit 626cc724ffa1d14cd74f48ff4f21ef443d832afa Author: Julia Signell Date: Tue Jun 29 11:50:36 2021 -0400 Allow mixing dask and numpy arrays in @guvectorize (#6863) dask/array/core.py | 7 ++++++- dask/array/tests/test_gufunc.py | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1345573285