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/4687#issuecomment-1003544001,https://api.github.com/repos/pydata/xarray/issues/4687,1003544001,IC_kwDOAMm_X8470N3B,14808389,2022-01-01T11:16:38Z,2022-01-02T21:30:36Z,MEMBER,"I believe it is best to allow customizing the behavior, so I added a `keep_attrs` parameter. I named the parameter `keep_attrs` but it could just as well be called `combine_attrs` (not sure which is better?) It defaults to dropping the attrs (`keep_attrs=False`) and will keep the attrs of `x` for `keep_attrs=True`. Because we're using `apply_ufunc` under the hood any value accepted by `merge_attrs` can be passed, with the only difference being that `keep_attrs=True` is *not* equal to `keep_attrs=""override""`.
Edit: using a different `keep_attrs` handler does not affect the name of the resulting object. Because this potentially seems like a breaking change I would do that change in a different PR if we think it is important.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913
https://github.com/pydata/xarray/pull/4687#issuecomment-920110705,https://api.github.com/repos/pydata/xarray/issues/4687,920110705,IC_kwDOAMm_X84218Zx,14808389,2021-09-15T15:13:02Z,2021-09-16T16:31:54Z,MEMBER,"yes, that's the plan (we changed the `keep_attrs` to affect both data / data variables and coordinates in a earlier release, although that's not consistent yet), but I'm surprised to hear that `xr.where` didn't drop attrs in `0.17`.
I'm a bit busy right now, but once things calm down a bit I'll try to finish this.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913
https://github.com/pydata/xarray/pull/4687#issuecomment-822747072,https://api.github.com/repos/pydata/xarray/issues/4687,822747072,MDEyOklzc3VlQ29tbWVudDgyMjc0NzA3Mg==,14808389,2021-04-19T20:01:57Z,2021-04-19T20:01:57Z,MEMBER,"I'm hoping to wait until `combine_attrs` is in `apply_ufunc`, so this is blocked by #5041","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913
https://github.com/pydata/xarray/pull/4687#issuecomment-773700137,https://api.github.com/repos/pydata/xarray/issues/4687,773700137,MDEyOklzc3VlQ29tbWVudDc3MzcwMDEzNw==,14808389,2021-02-05T00:40:45Z,2021-02-05T01:22:46Z,MEMBER,"> Is that because `apply_ufunc(..., keep_attrs=True)` keeps the attrs of the first argument?
yes, exactly. However, I think it would be easier to extend `keep_attrs` as described in https://github.com/pydata/xarray/issues/3891#issuecomment-773693380 and allow passing `keep_attrs` to `xr.where`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913
https://github.com/pydata/xarray/pull/4687#issuecomment-751895498,https://api.github.com/repos/pydata/xarray/issues/4687,751895498,MDEyOklzc3VlQ29tbWVudDc1MTg5NTQ5OA==,14808389,2020-12-28T23:30:53Z,2020-12-28T23:30:53Z,MEMBER,"> I would think the closest match is to return from `x` — that's the equivalent of `x.where(cond, other=y`?
I'm not sure how to implement that: I can get there by replacing `duck_array_ops.where` with `duck_array_ops.where_method`, but that yields a different dimension order after broadcasting (for the doctest examples `[""y"", ""x""]` instead of `[""x"", ""y""]`). This might not be that much of an issue since we generally tell people to use `transpose` before applying a function that depends on the order, though.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913
https://github.com/pydata/xarray/pull/4687#issuecomment-744708707,https://api.github.com/repos/pydata/xarray/issues/4687,744708707,MDEyOklzc3VlQ29tbWVudDc0NDcwODcwNw==,14808389,2020-12-14T21:02:52Z,2020-12-14T21:02:52Z,MEMBER,"yes, that's true. Maybe that's why we did not propagate the `attrs` before, even though it is really easy to implement?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913
https://github.com/pydata/xarray/pull/4687#issuecomment-744655107,https://api.github.com/repos/pydata/xarray/issues/4687,744655107,MDEyOklzc3VlQ29tbWVudDc0NDY1NTEwNw==,14808389,2020-12-14T19:20:39Z,2020-12-14T19:24:02Z,MEMBER,"After thinking about this some more, I decided that it would be good to have the behavior of `where` mirror the behavior of `DataArray.where`, `Dataset.where`, and `Variable.where`. Should we want to be able to control this using `set_options` we should do so for all them at once.
I also added a entry to `whats-new.rst`, but I'm not sure about putting this into `Breaking changes`. Is `Bug fixes` more appropriate?
Edit: it seems this also preserves the name of `cond`, which might not be what we want.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,765639913