Skip to content

Commit 4ca7945

Browse files
committed
wip
1 parent 76263da commit 4ca7945

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

pandas/tests/frame/methods/test_update.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,9 @@ def test_update_with_different_dtype(self):
152152
# GH#3217
153153
df = DataFrame({"a": [1, 3], "b": [np.nan, 2]})
154154
df["c"] = np.nan
155-
with tm.assert_produces_warning(FutureWarning, match="incompatible dtype"):
155+
with pytest.raises(TypeError, match="Invalid value"):
156156
df.update({"c": Series(["foo"], index=[0])})
157157

158-
expected = DataFrame(
159-
{
160-
"a": [1, 3],
161-
"b": [np.nan, 2],
162-
"c": Series(["foo", np.nan], dtype="object"),
163-
}
164-
)
165-
tm.assert_frame_equal(df, expected)
166-
167158
def test_update_modify_view(self, using_infer_string):
168159
# GH#47188
169160
df = DataFrame({"A": ["1", np.nan], "B": ["100", np.nan]})

pandas/tests/indexing/test_at.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@
2424
def test_at_timezone():
2525
# https://github.com/pandas-dev/pandas/issues/33544
2626
result = DataFrame({"foo": [datetime(2000, 1, 1)]})
27-
with tm.assert_produces_warning(FutureWarning, match="incompatible dtype"):
27+
with pytest.raises(TypeError, match="Invalid value"):
2828
result.at[0, "foo"] = datetime(2000, 1, 2, tzinfo=timezone.utc)
29-
expected = DataFrame(
30-
{"foo": [datetime(2000, 1, 2, tzinfo=timezone.utc)]}, dtype=object
31-
)
32-
tm.assert_frame_equal(result, expected)
3329

3430

3531
def test_selection_methods_of_assigned_col():

pandas/tests/indexing/test_iloc.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from pandas.errors import IndexingError
1010

1111
from pandas import (
12-
NA,
1312
Categorical,
1413
CategoricalDtype,
1514
DataFrame,
@@ -529,9 +528,8 @@ def test_iloc_setitem_frame_duplicate_columns_multiple_blocks(self):
529528

530529
# if the assigned values cannot be held by existing integer arrays,
531530
# we cast
532-
with tm.assert_produces_warning(FutureWarning, match="incompatible dtype"):
531+
with pytest.raises(TypeError, match="Invalid value"):
533532
df.iloc[:, 0] = df.iloc[:, 0] + 0.5
534-
assert len(df._mgr.blocks) == 2
535533

536534
expected = df.copy()
537535

@@ -1445,7 +1443,5 @@ def test_iloc_setitem_pure_position_based(self):
14451443
def test_iloc_nullable_int64_size_1_nan(self):
14461444
# GH 31861
14471445
result = DataFrame({"a": ["test"], "b": [np.nan]})
1448-
with tm.assert_produces_warning(FutureWarning, match="incompatible dtype"):
1446+
with pytest.raises(TypeError, match="Invalid value"):
14491447
result.loc[:, "b"] = result.loc[:, "b"].astype("Int64")
1450-
expected = DataFrame({"a": ["test"], "b": array([NA], dtype="Int64")})
1451-
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)