Skip to content

Commit 906127c

Browse files
committed
ValueError -> TypeError
1 parent e5d0f37 commit 906127c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

xarray/core/merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def merge(objects, compat='no_conflicts', join='outer', fill_value=dtypes.NA):
536536
dict_like_objects = list()
537537
for obj in objects:
538538
if not (isinstance(obj, (DataArray, Dataset, dict))):
539-
raise ValueError("'objects' must be an iterable containing only "
539+
raise TypeError("objects must be an iterable containing only "
540540
"Dataset(s), DataArray(s), and dictionaries.")
541541

542542
obj = obj.to_dataset() if isinstance(obj, DataArray) else obj

xarray/tests/test_merge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def test_merge_alignment_error(self):
6868
xr.merge([ds, other], join='exact')
6969

7070
def test_merge_wrong_input_error(self):
71-
with raises_regex(ValueError, "'objects' must be an iterable"):
71+
with raises_regex(TypeError, "objects must be an iterable"):
7272
xr.merge([1])
7373
ds = xr.Dataset(coords={'x': [1, 2]})
74-
with raises_regex(ValueError, "'objects' must be an iterable"):
74+
with raises_regex(TypeError, "objects must be an iterable"):
7575
xr.merge({'a': ds})
76-
with raises_regex(ValueError, "'objects' must be an iterable"):
76+
with raises_regex(TypeError, "objects must be an iterable"):
7777
xr.merge([ds, 1])
7878

7979
def test_merge_no_conflicts_single_var(self):

0 commit comments

Comments
 (0)