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/3595#issuecomment-564555360,https://api.github.com/repos/pydata/xarray/issues/3595,564555360,MDEyOklzc3VlQ29tbWVudDU2NDU1NTM2MA==,35968931,2019-12-11T14:02:06Z,2019-12-13T10:59:28Z,MEMBER,"When I wrote the (`set_options`) `keep_attrs` switch in then I intended it to function as a global switch, so ensuring that individual DataArray attrs are also propagated fits with that intention. I just apparently never thought of this case.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,532878771 https://github.com/pydata/xarray/issues/3595#issuecomment-562654276,https://api.github.com/repos/pydata/xarray/issues/3595,562654276,MDEyOklzc3VlQ29tbWVudDU2MjY1NDI3Ng==,5635139,2019-12-06T17:00:23Z,2019-12-06T17:00:23Z,MEMBER,"(forgive me, am on vacation) I actually didn't know about the multiple levels of `attrs`. Given that does exist, I agree with @dcherian re `keep_attrs` impacting individual variable attrs too. While it is a behavior change, I think it's fine: the current behavior is somewhere between a bug and an undocumented artefact. Unless others see a more material change here?","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,532878771 https://github.com/pydata/xarray/issues/3595#issuecomment-561819897,https://api.github.com/repos/pydata/xarray/issues/3595,561819897,MDEyOklzc3VlQ29tbWVudDU2MTgxOTg5Nw==,2448579,2019-12-04T20:13:57Z,2019-12-04T20:13:57Z,MEMBER,"I think that it's sensible that `keep_attrs` controls whether individual variable attrs are kept after mapping a function on each variable. This is a behaviour change though. I'm not sure how to deal with that. cc @max-sixty ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,532878771 https://github.com/pydata/xarray/issues/3595#issuecomment-561812950,https://api.github.com/repos/pydata/xarray/issues/3595,561812950,MDEyOklzc3VlQ29tbWVudDU2MTgxMjk1MA==,10194086,2019-12-04T19:54:57Z,2019-12-04T19:54:57Z,MEMBER,"Sorry, read before you edited - I can try to add a PR if you agree to change this behavior.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,532878771 https://github.com/pydata/xarray/issues/3595#issuecomment-561812227,https://api.github.com/repos/pydata/xarray/issues/3595,561812227,MDEyOklzc3VlQ29tbWVudDU2MTgxMjIyNw==,10194086,2019-12-04T19:53:06Z,2019-12-04T19:53:06Z,MEMBER,"Yes, it works for the Dataset-level attrs and the docstring also specifies that: ``` keep_attrs : bool, optional If True, the dataset's attributes (`attrs`) will be copied from the original object to the new one. If False, the new object will be returned without attributes. ``` So the question is more if this is the expected behaviour? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,532878771 https://github.com/pydata/xarray/issues/3595#issuecomment-561810709,https://api.github.com/repos/pydata/xarray/issues/3595,561810709,MDEyOklzc3VlQ29tbWVudDU2MTgxMDcwOQ==,2448579,2019-12-04T19:49:00Z,2019-12-04T19:52:10Z,MEMBER,"Looking at the code, `keep_attrs` controls whether the dataset attrs are kept, not the invidual variable attrs. https://github.com/pydata/xarray/blob/577d3a75ea8bb25b99f9d31af8da14210cddff78/xarray/core/dataset.py#L4233-L4240 This may be fixable by threading keep_attrs down through `maybe_wrap_array` and then ultimately to `Variable.__array_wrap__` when you can choose to keep attrs if `keep_attrs is True`. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,532878771