Skip to content

Commit e0ae758

Browse files
committed
Clarify index inference condition
1 parent 97ac4a6 commit e0ae758

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

xarray/core/combine.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,11 @@ def _dataarray_concat(arrays, dim, data_vars, coords, compat,
333333
)
334334
datasets = [arr.rename(name)._to_temp_dataset() for arr in arrays]
335335

336-
if isinstance(dim, str) and len(set(names) - {None}) == len(names) \
337-
and not any(dim in a.dims or dim in a.coords for a in arrays):
336+
if (
337+
isinstance(dim, str)
338+
and len(set(names) - {None}) == len(names)
339+
and not any(dim in a.dims or dim in a.coords for a in arrays
340+
):
338341
# We're concatenating arrays with unique non-None names along
339342
# a new dimension, so we use the existing names as coordinates.
340343
dim = pd.Index(names, name=dim)

0 commit comments

Comments
 (0)