Skip to content

Commit 5b64e6f

Browse files
committed
fix dataset test bug
1 parent 562ba92 commit 5b64e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xarray/core/groupby.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def __init__(self, obj, group, squeeze=False, grouper=None):
101101
"""
102102
from .dataset import as_dataset
103103

104+
if getattr(group, 'name', None) is None:
105+
raise ValueError('`group` must have a name')
104106
self._stacked_dim = None
105107
group_name = group.name
106108
if group.ndim != 1:
@@ -119,8 +121,6 @@ def __init__(self, obj, group, squeeze=False, grouper=None):
119121
# we also need to rename the group name to avoid a conflict when
120122
# concatenating
121123
group_name += '_groups'
122-
if getattr(group, 'name', None) is None:
123-
raise ValueError('`group` must have a name')
124124
if not hasattr(group, 'dims'):
125125
raise ValueError("`group` must have a 'dims' attribute")
126126
group_dim, = group.dims
@@ -412,7 +412,7 @@ def _concat(self, applied, shortcut=False):
412412
# peek at applied to determine which coordinate to stack over
413413
applied_example, applied = peek_at(applied)
414414
concat_dim, positions = self._infer_concat_args(applied_example)
415-
415+
print('concat_dim and positions', concat_dim, positions)
416416
if shortcut:
417417
combined = self._concat_shortcut(applied, concat_dim, positions)
418418
else:

0 commit comments

Comments
 (0)