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-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** ``` <xarray.Dataset> Dimensions: (location: 3, time: 731) Coordinates: * time (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31 * location (location) <U2 'IA' 'IN' 'IL' Data variables: tmin (time, location) float32 -8.03737 -1.7884412 ... -4.543927 tmax (time, location) float32 12.980549 3.3104093 ... 3.8052793 Attributes: CRS: EPSG:4326 ``` **Output 2** ``` Original xr.DataArray attrs: {'at_str': 'at1_value', 'at_float': 123.0, 'at_int': 123} dtype: int64 After casting to int64: {'at_str': 'at1_value', 'at_float': 123.0, 'at_int': 123} After casting to int32: {'at_str': 'at1_value', 'at_float': 123.0, 'at_int': 123} After casting to float32: {'at_str': 'at1_value', 'at_float': 123.0, 'at_int': 123} Changing the np.array attrs: {'at_str': 'at1_value', 'at_float': 123.0, 'at_int': 123} dtype: float32 ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499196320