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/issues/5559#issuecomment-872502631,https://api.github.com/repos/pydata/xarray/issues/5559,872502631,MDEyOklzc3VlQ29tbWVudDg3MjUwMjYzMQ==,2448579,2021-07-01T19:41:14Z,2021-07-01T19:41:14Z,MEMBER,"> And the solution would be to just call the method on the duck array without any kind of type checking first?
Or `np.method(array)`","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,935062144
https://github.com/pydata/xarray/issues/5559#issuecomment-872499933,https://api.github.com/repos/pydata/xarray/issues/5559,872499933,MDEyOklzc3VlQ29tbWVudDg3MjQ5OTkzMw==,35968931,2021-07-01T19:35:43Z,2021-07-01T19:35:43Z,MEMBER,So this is actually an xarray problem not a dask/pint problem? And the solution would be to just call the method on the duck array without any kind of type checking first?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,935062144
https://github.com/pydata/xarray/issues/5559#issuecomment-872477132,https://api.github.com/repos/pydata/xarray/issues/5559,872477132,MDEyOklzc3VlQ29tbWVudDg3MjQ3NzEzMg==,2448579,2021-07-01T18:56:41Z,2021-07-01T18:59:27Z,MEMBER,"> Is it correct that xarray ends up calling dask.array.mean() on the pint.Quantity(dask.Array) object inside the DataArray?
Yes that's correct. See
https://github.com/pydata/xarray/blob/c472f8a4c79f872edb9dcd7825f786ecb9aff5c0/xarray/core/duck_array_ops.py#L49-L51
It may be time to update this method since we now depend on a minimum numpy version that supports NEP-18.
cc @shoyer
EDIT: You get there from `_create_nan_agg_method`: https://github.com/pydata/xarray/blob/c472f8a4c79f872edb9dcd7825f786ecb9aff5c0/xarray/core/duck_array_ops.py#L347","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,935062144