@@ -591,8 +591,10 @@ def test_concat_coords(self, coords) -> None:
591
591
data .isel (x = slice (5 )).assign_coords (c = 0 ),
592
592
data .isel (x = slice (5 , None )).assign_coords (c = 1 ),
593
593
]
594
- extra_kwargs = dict (compat = "equals" ) if coords == "different" else {}
595
- actual = concat (objs , dim = "x" , coords = coords , ** extra_kwargs )
594
+ if coords == "different" :
595
+ actual = concat (objs , dim = "x" , coords = coords , compat = "equals" )
596
+ else :
597
+ actual = concat (objs , dim = "x" , coords = coords )
596
598
assert_identical (expected , actual )
597
599
598
600
@pytest .mark .parametrize ("coords" , ["minimal" , []])
@@ -611,8 +613,10 @@ def test_concat_constant_index(self, data_vars) -> None:
611
613
ds1 = Dataset ({"foo" : 1.5 }, {"y" : 1 })
612
614
ds2 = Dataset ({"foo" : 2.5 }, {"y" : 1 })
613
615
expected = Dataset ({"foo" : ("y" , [1.5 , 2.5 ]), "y" : [1 , 1 ]})
614
- extra_kwargs = dict (compat = "equals" ) if data_vars == "different" else {}
615
- actual = concat ([ds1 , ds2 ], "y" , data_vars = data_vars , ** extra_kwargs )
616
+ if data_vars == "different" :
617
+ actual = concat ([ds1 , ds2 ], "y" , data_vars = data_vars , compat = "equals" )
618
+ else :
619
+ actual = concat ([ds1 , ds2 ], "y" , data_vars = data_vars )
616
620
assert_identical (expected , actual )
617
621
618
622
def test_concat_constant_index_minimal_raises_merge_error (self ) -> None :
@@ -677,13 +681,13 @@ def test_concat_errors(self) -> None:
677
681
assert_identical (data , concat ([data0 , data1 ], "dim1" , compat = "equals" ))
678
682
679
683
with pytest .raises (ValueError , match = r"compat.* invalid" ):
680
- concat (split_data , "dim1" , compat = "foobar" )
684
+ concat (split_data , "dim1" , compat = "foobar" ) # type: ignore[call-overload]
681
685
682
686
with pytest .raises (ValueError , match = r"compat.* invalid" ):
683
687
concat (split_data , "dim1" , compat = "minimal" )
684
688
685
689
with pytest .raises (ValueError , match = r"unexpected value for" ):
686
- concat ([data , data ], "new_dim" , coords = "foobar" )
690
+ concat ([data , data ], "new_dim" , coords = "foobar" ) # type: ignore[call-overload]
687
691
688
692
with pytest .raises (
689
693
ValueError , match = r"coordinate in some datasets but not others"
0 commit comments