id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 1386596170,PR_kwDOAMm_X84_olQw,7085,solve a bug when the units attribute is not a string ,10563614,closed,0,,,2,2022-09-26T19:27:08Z,2022-09-28T19:13:11Z,2022-09-28T19:13:11Z,CONTRIBUTOR,,0,pydata/xarray/pulls/7085," - [ ] Closes #xxxx - [x] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` We faced a sort of bug with a colleague of mine. It seems to be legal to set a numeric value to the units attributes in an xarray or a netcdf file. xarray accepts to save such an array to netcdf: xr.DataArray([1, 2, 3], attrs={'units': 1}, name='x').to_csv('tmp.nc'). Reading this netcdf file with xarray.open_dataset raises an error. It is unlikely to have a scalar for the units, but at least it happened to us (the value was NaN) and this raised an exception very difficult to understand. This raises an exception because ```""since"" in attrs[""units""]``` was called twice in xarray codebase (in coding_times.py and in conventions.py) without checking for the type of the attribute. This PR solves this improbable bug ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7085/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 705182835,MDExOlB1bGxSZXF1ZXN0NDg5OTU2NDQ2,4442,Fix DataArray.to_dataframe when the array has MultiIndex,10563614,closed,0,,,4,2020-09-20T20:45:12Z,2021-02-20T00:08:42Z,2021-02-20T00:08:42Z,CONTRIBUTOR,,0,pydata/xarray/pulls/4442," - [X] Closes #3008 - [x] Tests added - [x] Passes `isort . && black . && mypy . && flake8` - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4442/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull