From b09a160b0fc93a97ed27d2aeb62cf1a19e6b7565 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sat, 25 Nov 2023 23:41:08 +0100 Subject: [PATCH] CoW: Warn for cases that go through putmask --- pandas/tests/apply/test_invalid_arg.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pandas/tests/apply/test_invalid_arg.py b/pandas/tests/apply/test_invalid_arg.py index 9f5157181843e..80b2cce8c1dbc 100644 --- a/pandas/tests/apply/test_invalid_arg.py +++ b/pandas/tests/apply/test_invalid_arg.py @@ -18,7 +18,6 @@ DataFrame, Series, date_range, - notna, ) import pandas._testing as tm @@ -150,8 +149,6 @@ def test_transform_axis_1_raises(): Series([1]).transform("sum", axis=1) -# TODO(CoW-warn) should not need to warn -@pytest.mark.filterwarnings("ignore:Setting a value on a view:FutureWarning") def test_apply_modify_traceback(): data = DataFrame( { @@ -207,11 +204,6 @@ def transform(row): row["D"] = 7 return row - def transform2(row): - if notna(row["C"]) and row["C"].startswith("shin") and row["A"] == "foo": - row["D"] = 7 - return row - msg = "'float' object has no attribute 'startswith'" with pytest.raises(AttributeError, match=msg): data.apply(transform, axis=1)