@@ -191,14 +191,11 @@ def test_setitem_series_object_dtype(self, indexer, ser_index):
191
191
expected = Series ([Series ([42 ], index = [ser_index ]), 0 ], dtype = "object" )
192
192
tm .assert_series_equal (ser , expected )
193
193
194
- @pytest .mark .parametrize (
195
- "index, exp_value, warn" , [(0 , 42 , None ), (1 , np .nan , FutureWarning )]
196
- )
197
- def test_setitem_series (self , index , exp_value , warn ):
194
+ @pytest .mark .parametrize ("index, exp_value" , [(0 , 42 ), (1 , np .nan )])
195
+ def test_setitem_series (self , index , exp_value ):
198
196
# GH#38303
199
197
ser = Series ([0 , 0 ])
200
- with tm .assert_produces_warning (warn , match = "item of incompatible dtype" ):
201
- ser .loc [0 ] = Series ([42 ], index = [index ])
198
+ ser .loc [0 ] = Series ([42 ], index = [index ])
202
199
expected = Series ([exp_value , 0 ])
203
200
tm .assert_series_equal (ser , expected )
204
201
@@ -575,15 +572,15 @@ def test_setitem_keep_precision(self, any_numeric_ea_dtype):
575
572
[
576
573
(NA , NA , "Int64" , "Int64" , 1 , None ),
577
574
(NA , NA , "Int64" , "Int64" , 2 , None ),
578
- (NA , np .nan , "int64" , "float64" , 1 , FutureWarning ),
575
+ (NA , np .nan , "int64" , "float64" , 1 , None ),
579
576
(NA , np .nan , "int64" , "float64" , 2 , None ),
580
577
(NaT , NaT , "int64" , "object" , 1 , FutureWarning ),
581
578
(NaT , NaT , "int64" , "object" , 2 , None ),
582
579
(np .nan , NA , "Int64" , "Int64" , 1 , None ),
583
580
(np .nan , NA , "Int64" , "Int64" , 2 , None ),
584
581
(np .nan , NA , "Float64" , "Float64" , 1 , None ),
585
582
(np .nan , NA , "Float64" , "Float64" , 2 , None ),
586
- (np .nan , np .nan , "int64" , "float64" , 1 , FutureWarning ),
583
+ (np .nan , np .nan , "int64" , "float64" , 1 , None ),
587
584
(np .nan , np .nan , "int64" , "float64" , 2 , None ),
588
585
],
589
586
)
@@ -592,7 +589,7 @@ def test_setitem_enlarge_with_na(
592
589
):
593
590
# GH#32346
594
591
ser = Series ([1 , 2 ], dtype = dtype )
595
- with tm .assert_produces_warning (warn , match = "item of incompatible dtype" ):
592
+ with tm .assert_produces_warning (warn , match = "incompatible dtype" ):
596
593
ser [indexer ] = na
597
594
expected_values = [1 , target_na ] if indexer == 1 else [1 , 2 , target_na ]
598
595
expected = Series (expected_values , dtype = target_dtype )
@@ -884,7 +881,7 @@ def test_index_putmask(self, obj, key, expected, warn, val):
884
881
Series ([2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]),
885
882
Series ([np .nan , 3 , np .nan , 5 , np .nan , 7 , np .nan , 9 , np .nan ]),
886
883
slice (None , None , 2 ),
887
- FutureWarning ,
884
+ None ,
888
885
id = "int_series_slice_key_step" ,
889
886
),
890
887
pytest .param (
@@ -899,15 +896,15 @@ def test_index_putmask(self, obj, key, expected, warn, val):
899
896
Series (np .arange (10 )),
900
897
Series ([np .nan , np .nan , np .nan , np .nan , np .nan , 5 , 6 , 7 , 8 , 9 ]),
901
898
slice (None , 5 ),
902
- FutureWarning ,
899
+ None ,
903
900
id = "int_series_slice_key" ,
904
901
),
905
902
pytest .param (
906
903
# changes dtype GH#4463
907
904
Series ([1 , 2 , 3 ]),
908
905
Series ([np .nan , 2 , 3 ]),
909
906
0 ,
910
- FutureWarning ,
907
+ None ,
911
908
id = "int_series_int_key" ,
912
909
),
913
910
pytest .param (
@@ -1134,7 +1131,7 @@ def warn(self):
1134
1131
"obj,expected,warn" ,
1135
1132
[
1136
1133
# For numeric series, we should coerce to NaN.
1137
- (Series ([1 , 2 , 3 ]), Series ([np .nan , 2 , 3 ]), FutureWarning ),
1134
+ (Series ([1 , 2 , 3 ]), Series ([np .nan , 2 , 3 ]), None ),
1138
1135
(Series ([1.0 , 2.0 , 3.0 ]), Series ([np .nan , 2.0 , 3.0 ]), None ),
1139
1136
# For datetime series, we should coerce to NaT.
1140
1137
(
@@ -1584,13 +1581,11 @@ def test_20643_comment():
1584
1581
expected = Series ([np .nan , 1 , 2 ], index = ["a" , "b" , "c" ])
1585
1582
1586
1583
ser = orig .copy ()
1587
- with tm .assert_produces_warning (FutureWarning , match = "incompatible dtype" ):
1588
- ser .iat [0 ] = None
1584
+ ser .iat [0 ] = None
1589
1585
tm .assert_series_equal (ser , expected )
1590
1586
1591
1587
ser = orig .copy ()
1592
- with tm .assert_produces_warning (FutureWarning , match = "incompatible dtype" ):
1593
- ser .iloc [0 ] = None
1588
+ ser .iloc [0 ] = None
1594
1589
tm .assert_series_equal (ser , expected )
1595
1590
1596
1591
0 commit comments