@@ -197,9 +197,15 @@ def test_merge_arrays_attrs_variables(
197
197
198
198
if expect_exception :
199
199
with pytest .raises (MergeError , match = "combine_attrs" ):
200
- actual = xr .merge ([data1 , data2 ], combine_attrs = combine_attrs )
200
+ with pytest .warns (
201
+ FutureWarning ,
202
+ match = "will change from compat='no_conflicts' to compat='override'" ,
203
+ ):
204
+ actual = xr .merge ([data1 , data2 ], combine_attrs = combine_attrs )
201
205
else :
202
- actual = xr .merge ([data1 , data2 ], combine_attrs = combine_attrs )
206
+ actual = xr .merge (
207
+ [data1 , data2 ], compat = "no_conflicts" , combine_attrs = combine_attrs
208
+ )
203
209
expected = xr .Dataset (
204
210
{"var1" : ("dim1" , [], expected_attrs )},
205
211
coords = {"dim1" : ("dim1" , [], expected_attrs )},
@@ -324,12 +330,12 @@ def test_merge_no_conflicts_preserve_attrs(self):
324
330
325
331
def test_merge_no_conflicts_broadcast (self ):
326
332
datasets = [xr .Dataset ({"x" : ("y" , [0 ])}), xr .Dataset ({"x" : np .nan })]
327
- actual = xr .merge (datasets )
333
+ actual = xr .merge (datasets , compat = "no_conflicts" )
328
334
expected = xr .Dataset ({"x" : ("y" , [0 ])})
329
335
assert_identical (expected , actual )
330
336
331
337
datasets = [xr .Dataset ({"x" : ("y" , [np .nan ])}), xr .Dataset ({"x" : 0 })]
332
- actual = xr .merge (datasets )
338
+ actual = xr .merge (datasets , compat = "no_conflicts" )
333
339
assert_identical (expected , actual )
334
340
335
341
@@ -562,7 +568,11 @@ def test_merge_broadcast_equals(self):
562
568
ds2 = xr .Dataset ({"x" : ("y" , [0 , 0 ])})
563
569
564
570
with set_options (use_new_combine_kwarg_defaults = False ):
565
- old = ds1 .merge (ds2 )
571
+ with pytest .warns (
572
+ FutureWarning ,
573
+ match = "will change from compat='no_conflicts' to compat='override'" ,
574
+ ):
575
+ old = ds1 .merge (ds2 )
566
576
567
577
with set_options (use_new_combine_kwarg_defaults = True ):
568
578
new = ds1 .merge (ds2 )
0 commit comments