Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion xarray/backends/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def _sanitize_unlimited_dims(dataset, unlimited_dims):
f"but not part of current dataset dimensions. "
f"Consider removing {undeclared_dims!r} from {msg_origin!r}."
)
raise ValueError(msg)
if msg_origin == "unlimited_dims-kwarg":
raise ValueError(msg)
else:
emit_user_level_warning(msg)
return unlimited_dims


Expand Down
4 changes: 2 additions & 2 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,8 +1399,8 @@ def test_encoding_unlimited_dims(self) -> None:
# test unlimited_dims validation
# https://github.com/pydata/xarray/issues/10549
ds.encoding = {"unlimited_dims": "z"}
with pytest.raises(
ValueError,
with pytest.warns(
UserWarning,
match=r"Unlimited dimension\(s\) .* declared in 'dataset.encoding'",
):
with self.roundtrip(ds) as _:
Expand Down
Loading