Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiindex error on upstream xr (#1450)
<!--Please ensure the PR fulfills the following requirements! --> <!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! --> ### Pull Request Checklist: - [x] This PR addresses an already opened issue (for bug fixes / features) - This PR fixes #1417 - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] (If applicable) Documentation has been added / updated (for bug fixes / features) - [x] CHANGES.rst has been updated (with summary of main changes) - [x] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added ### What kind of change does this PR introduce? Overriding a coordinate with a pandas MultiIndex was not working properly before, but this didn't result in any errors up to a recent change in xarray's master. When calling `assign_coords` with a multiindex on a coordinate that already existed, the sub-indexes would not appear in the DataArray repr. In the most recent xarray master, that now triggers an error when trying to unstack the multiindex, but only if dask is used. Before, the unstacking would proceed as normal and the sub-indexes would magically appear on the result. Dropping the previous coordinate solves this problem. The next xarray will implement a new public `xr.Coordinates` class that should be used to assign coords, instead of a raw `pd.MultiIndex`. Nonetheless, overriding is still not possible and dropping the previous coordinate is still needed. ### Does this PR introduce a breaking change? No. ### Other information: See pydata/xarray#8039.
- Loading branch information