File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ def get_indexes(name):
658
658
for name , result_var in result_vars .items ()
659
659
if name in coord_names
660
660
}
661
+ result_data_vars = {
662
+ name : result_var
663
+ for name , result_var in result_vars .items ()
664
+ if name not in coord_names
665
+ }
661
666
662
667
if index is not None :
663
668
if dim_var is not None :
@@ -668,16 +673,14 @@ def get_indexes(name):
668
673
coord_vars [dim ] = index_vars [dim ]
669
674
result_indexes [dim ] = index
670
675
unlabeled_dims = unlabeled_dims - set ([dim ])
676
+ else :
677
+ if dim in result_data_vars :
678
+ coord_vars [dim ] = result_data_vars [dim ]
679
+ result_data_vars .pop (dim )
671
680
672
681
# TODO: add indexes at Dataset creation (when it is supported)
673
682
coords = Coordinates (coord_vars , indexes = result_indexes )
674
683
675
- result_data_vars = {
676
- name : result_var
677
- for name , result_var in result_vars .items ()
678
- if name not in coord_names
679
- }
680
-
681
684
result = type (datasets [0 ])(result_data_vars , coords = coords , attrs = result_attrs )
682
685
result .encoding = result_encoding
683
686
You can’t perform that action at this time.
0 commit comments