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/3348#issuecomment-750934788,https://api.github.com/repos/pydata/xarray/issues/3348,750934788,MDEyOklzc3VlQ29tbWVudDc1MDkzNDc4OA==,10194086,2020-12-24T17:47:34Z,2020-12-24T17:47:34Z,MEMBER,"Yes, this is fixed so I am closing. Thanks for noting @rhkleijn ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499196320 https://github.com/pydata/xarray/issues/3348#issuecomment-750929476,https://api.github.com/repos/pydata/xarray/issues/3348,750929476,MDEyOklzc3VlQ29tbWVudDc1MDkyOTQ3Ng==,32801740,2020-12-24T17:12:15Z,2020-12-24T17:12:15Z,CONTRIBUTOR,"``Dataset.astype()`` preserves attributes by default since xarray 0.16.1 with #4314. Running the scripts above with 0.16.2 I get the output below, which confirms attributes are now preserved. Can this issue be closed? **Output 1** ``` Dimensions: (location: 3, time: 731) Coordinates: * time (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31 * location (location) Should we switch `keep_attrs` to `True` by default or be determined by the global `keep_attrs` setting? (also I don't know why this worked in 0.12.1) Do we have a view that this should be `False` by default, or is it the case for historical reasons?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499196320 https://github.com/pydata/xarray/issues/3348#issuecomment-535981805,https://api.github.com/repos/pydata/xarray/issues/3348,535981805,MDEyOklzc3VlQ29tbWVudDUzNTk4MTgwNQ==,2448579,2019-09-27T15:13:32Z,2019-09-27T15:13:32Z,MEMBER,"I guess the simpler solution is to just add an `astype` method to `Dataset` and specify `keep_attrs=True` like https://github.com/pydata/xarray/blob/6ece6a1cf424c3080e216fad8fc8058d3b70aadc/xarray/core/dataset.py#L5062-L5063 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499196320 https://github.com/pydata/xarray/issues/3348#issuecomment-535979151,https://api.github.com/repos/pydata/xarray/issues/3348,535979151,MDEyOklzc3VlQ29tbWVudDUzNTk3OTE1MQ==,2448579,2019-09-27T15:06:47Z,2019-09-27T15:06:47Z,MEMBER,"Should we switch `keep_attrs` to `True` by default or be determined by the global `keep_attrs` setting? (also I don't know why this worked in 0.12.1) https://github.com/pydata/xarray/blob/6ece6a1cf424c3080e216fad8fc8058d3b70aadc/xarray/core/dataset.py#L4388-L4401 The more general solution for DataArrays is to finish up #2070 (see also #2049). @robbibt are you you up for doing this?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499196320