Skip to content

Commit

Permalink
update compat error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
VeckoTheGecko committed Sep 20, 2024
1 parent 6a2eddd commit 2090862
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/core/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def concat(
except StopIteration:
raise ValueError("must supply at least one object to concatenate")

if compat not in _VALID_COMPAT:
if compat not in set(_VALID_COMPAT) - {"minimal"}:
raise ValueError(
f"compat={compat!r} invalid: must be 'broadcast_equals', 'equals', 'identical', 'no_conflicts' or 'override'"
)
Expand Down
3 changes: 3 additions & 0 deletions xarray/tests/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@ def test_concat_errors(self):

with pytest.raises(ValueError, match=r"compat.* invalid"):
concat(split_data, "dim1", compat="foobar")

with pytest.raises(ValueError, match=r"compat.* invalid"):
concat(split_data, "dim1", compat="minimal")

with pytest.raises(ValueError, match=r"unexpected value for"):
concat([data, data], "new_dim", coords="foobar")
Expand Down

0 comments on commit 2090862

Please sign in to comment.