Skip to content

Commit 5de44ba

Browse files
committed
Add test
1 parent 7240729 commit 5de44ba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

xarray/tests/test_concat.py

+9
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,15 @@ def test_concat_str_dtype(self, dtype, dim):
678678

679679
assert np.issubdtype(actual.x2.dtype, dtype)
680680

681+
def test_concat_coord_name(self):
682+
683+
da = DataArray([0], dims="a")
684+
da_concat = concat([da, da], dim=DataArray([0, 1], dims="b"))
685+
assert list(da_concat.coords) == ["b"]
686+
687+
da_concat_std = concat([da, da], dim=DataArray([0, 1]))
688+
assert list(da_concat_std.coords) == ["dim_0"]
689+
681690

682691
@pytest.mark.parametrize("attr1", ({"a": {"meta": [10, 20, 30]}}, {"a": [1, 2, 3]}, {}))
683692
@pytest.mark.parametrize("attr2", ({"a": [1, 2, 3]}, {}))

0 commit comments

Comments
 (0)