Skip to content

Commit ab33493

Browse files
committed
fix bad dataset creation
1 parent 1ea8666 commit ab33493

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xarray/core/dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2802,12 +2802,13 @@ def _rename_all(self, name_dict, dims_dict):
28022802
# Variable could be renamed to an existing dimension name
28032803
# in this case, convert to IndexVariable and set indexes
28042804
# GH4107
2805-
for name in set(coord_names) & set(self.dims):
2805+
for name in set(self.dims):
28062806
indexvar = variables.pop(name).to_index_variable()
28072807
variables[name] = indexvar
28082808
if indexes is None:
28092809
indexes = dict()
28102810
indexes[name] = indexvar.to_index()
2811+
coord_names.add(name)
28112812

28122813
return variables, coord_names, dims, indexes
28132814

0 commit comments

Comments
 (0)