id,node_id,number,state,locked,title,user,body,created_at,updated_at,closed_at,merged_at,merge_commit_sha,assignee,milestone,draft,head,base,author_association,auto_merge,repo,url,merged_by 333665410,MDExOlB1bGxSZXF1ZXN0MzMzNjY1NDEw,3455,closed,0,Update terminology.rst,29958771,"Fixed broken link ",2019-10-29T14:49:00Z,2019-10-29T15:36:04Z,2019-10-29T15:36:04Z,2019-10-29T15:36:04Z,d197c8192b086451882bdcac66147a5099361328,,,0,9ee5012ea208069eb962ddc22b2eb5c27fe1fd5a,e183c7a836db98ddd54a70770fa3c4e4c3aea103,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/3455, 380575560,MDExOlB1bGxSZXF1ZXN0MzgwNTc1NTYw,3801,closed,0,Coarsen keep attrs 3376,29958771," - [x] Closes #3376 - [x] Tests added - [x] Passes `isort -rc . && black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API I also noticed missing attributes when attempting certain operations, so I have created this pull request to attempt a fix. I modified code in `DataWithCoords.coarsen()` to try applying the same logic used for other methods since #2482 was successfully merged. I added two new tests that adapt the bug reported by @jejjohnson. I believe they should pass when this is fixed. One uses `Dataset.coarsen()` and the other uses `Variable.coarsen`. Both tests currently fail. xarray/tests/test_dataset.py::TestDataset::test_coarsen_keep_attrs - fails because my attempted fix does not retain the attributes. xarray/tests/test_variable.py::TestVariable::test_coarsen_keep_attrs - also fails, but unexpectedly this seems to be because the attributes are _not_ removed by default, or even when explicitly setting the global option to False. ",2020-02-27T00:29:13Z,2020-03-06T16:33:11Z,2020-03-02T23:02:56Z,2020-03-02T23:02:55Z,1c5e1cd022a0ff91275c50a50d1c6f88a7abff7d,,,0,4968c440d439d39dc9b6a068f7e65ad06cf81afe,8512b7bf498c0c300f146447c0b05545842e9404,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/3801,