Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jan 16, 2021
1 parent cfcbfc4 commit bbd24d5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3032,12 +3032,13 @@ def _rename_all(self, name_dict, dims_dict):
# in this case, convert to IndexVariable and set indexes
# GH4107
for name in set(self.dims):
indexvar = variables.pop(name).to_index_variable()
variables[name] = indexvar
if indexes is None:
indexes = dict()
indexes[name] = indexvar.to_index()
coord_names.add(name)
if name in variables:
indexvar = variables.pop(name).to_index_variable()
variables[name] = indexvar
if indexes is None:
indexes = dict()
indexes[name] = indexvar.to_index()
coord_names.add(name)

return variables, coord_names, dims, indexes

Expand Down

0 comments on commit bbd24d5

Please sign in to comment.