@@ -42,27 +42,17 @@ def test_where_unsafe_float(float_numpy_dtype):
42
42
@pytest .mark .parametrize (
43
43
"dtype,expected_dtype" ,
44
44
[
45
- (np .int8 , np .float64 ),
46
- (np .int16 , np .float64 ),
47
- (np .int32 , np .float64 ),
48
- (np .int64 , np .float64 ),
49
45
(np .float32 , np .float32 ),
50
46
(np .float64 , np .float64 ),
51
47
],
52
48
)
53
- def test_where_unsafe_upcast (dtype , expected_dtype ):
49
+ def test_where_upcast (dtype , expected_dtype ):
54
50
# see gh-9743
55
51
s = Series (np .arange (10 ), dtype = dtype )
56
52
values = [2.5 , 3.5 , 4.5 , 5.5 , 6.5 ]
57
53
mask = s < 5
58
54
expected = Series (values + list (range (5 , 10 )), dtype = expected_dtype )
59
- warn = (
60
- None
61
- if np .dtype (dtype ).kind == np .dtype (expected_dtype ).kind == "f"
62
- else FutureWarning
63
- )
64
- with tm .assert_produces_warning (warn , match = "incompatible dtype" ):
65
- s [mask ] = values
55
+ s [mask ] = values
66
56
tm .assert_series_equal (s , expected )
67
57
68
58
@@ -74,10 +64,6 @@ def test_where_unsafe():
74
64
mask = s > 5
75
65
expected = Series (list (range (6 )) + values , dtype = "float64" )
76
66
77
- with tm .assert_produces_warning (FutureWarning , match = "incompatible dtype" ):
78
- s [mask ] = values
79
- tm .assert_series_equal (s , expected )
80
-
81
67
# see gh-3235
82
68
s = Series (np .arange (10 ), dtype = "int64" )
83
69
mask = s < 5
0 commit comments