Skip to content

Commit 83f227c

Browse files
committed
regression test for pydata#9485
1 parent 8eeae1d commit 83f227c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

xarray/tests/test_datatree.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,12 @@ def test_inherited(self):
718718
# expected = child.assign_coords({"c": 11})
719719
# assert_identical(expected, actual)
720720

721+
def test_forbid_paths_as_names(self):
722+
# regression test for GH issue #9485
723+
dt = DataTree(Dataset(coords={"x": 0}), children={"child": DataTree()})
724+
with pytest.raises(ValueError, match="cannot have names containing"):
725+
dt.coords["/child/y"] = 2
726+
721727

722728
def test_delitem():
723729
ds = Dataset({"a": 0}, coords={"x": ("x", [1, 2]), "z": "a"})

0 commit comments

Comments
 (0)