Skip to content
forked from pydata/xarray

Commit

Permalink
Look for concat dim in data_vars also.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Sep 10, 2019
1 parent 6e4727a commit 71ec88d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/core/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ def _dataset_concat(
dim_coords.pop(dim, None)
dims_sizes.pop(dim, None)

# case where concat dimension is a coordinate but not a dimension
if dim in coord_names and dim not in dim_names:
# case where concat dimension is a coordinate or data_var but not a dimension
if (dim in coord_names or dim in data_names) and dim not in dim_names:
datasets = [ds.expand_dims(dim) for ds in datasets]

# determine which variables to concatentate
Expand Down

0 comments on commit 71ec88d

Please sign in to comment.