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/5284#issuecomment-849811814,https://api.github.com/repos/pydata/xarray/issues/5284,849811814,MDEyOklzc3VlQ29tbWVudDg0OTgxMTgxNA==,5635139,2021-05-27T17:31:02Z,2021-05-27T17:31:02Z,MEMBER,Thank you very much @AndrewWilliams3142 !,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,882876804
https://github.com/pydata/xarray/pull/5284#issuecomment-849169576,https://api.github.com/repos/pydata/xarray/issues/5284,849169576,MDEyOklzc3VlQ29tbWVudDg0OTE2OTU3Ng==,5635139,2021-05-26T22:46:43Z,2021-05-26T22:46:43Z,MEMBER,Please feel free to add a whatsnew @AndrewWilliams3142 ,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,882876804
https://github.com/pydata/xarray/pull/5284#issuecomment-837097308,https://api.github.com/repos/pydata/xarray/issues/5284,837097308,MDEyOklzc3VlQ29tbWVudDgzNzA5NzMwOA==,2448579,2021-05-10T18:25:29Z,2021-05-10T18:25:29Z,MEMBER,"Well that was confusing! `if missing_vals.any():` will not be triggered if all the values in a block are valid. With `.chunk({""time"": 1})`, some of the blocks are all valid.
I discovered this with `print` debugging and the single-threaded scheduler which loops over blocks in a for-loop
```
# Define function to use in map_blocks
def _get_valid_values(da, other):
da1, da2 = xr.align(da, other, join=""inner"", copy=False)
# 2. Ignore the nans
missing_vals = np.logical_or(da1.isnull(), da2.isnull())
print(missing_vals)
if missing_vals.any():
da = da.where(missing_vals)
return da
da_a.map_blocks(_get_valid_values, args=[da_b]).compute(scheduler=""sync"")
```
For better performance, we should try a `dask.array.map_blocks` approach with `duck_array_ops.isnull` ","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,882876804
https://github.com/pydata/xarray/pull/5284#issuecomment-837045902,https://api.github.com/repos/pydata/xarray/issues/5284,837045902,MDEyOklzc3VlQ29tbWVudDgzNzA0NTkwMg==,14808389,2021-05-10T17:53:05Z,2021-05-10T17:53:05Z,MEMBER,"#4559 and #4668 fixed a similar issue using `map_blocks`, maybe you can use that as a reference?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,882876804
https://github.com/pydata/xarray/pull/5284#issuecomment-835907226,https://api.github.com/repos/pydata/xarray/issues/5284,835907226,MDEyOklzc3VlQ29tbWVudDgzNTkwNzIyNg==,5635139,2021-05-09T22:15:25Z,2021-05-09T22:15:25Z,MEMBER,"Hi @AndrewWilliams3142 , thanks for another PR!
This looks good. Could we add a test like https://github.com/pydata/xarray/pull/4559/files#diff-74d2dc289aa601b2de094fb3a3b687fd65963401b51b95cc5e0afcd06cc4cb82R45? And maybe reference this or #4559 as an explanation of what's going on.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,882876804