Skip to content

Commit 4c520e3

Browse files
authored
CoW: Remove todos that aren't necessary (#56169)
1 parent 13bdca4 commit 4c520e3

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pandas/tests/apply/test_invalid_arg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_transform_axis_1_raises():
152152

153153
# TODO(CoW-warn) should not need to warn
154154
@pytest.mark.filterwarnings("ignore:Setting a value on a view:FutureWarning")
155-
def test_apply_modify_traceback():
155+
def test_apply_modify_traceback(warn_copy_on_write):
156156
data = DataFrame(
157157
{
158158
"A": [
@@ -214,7 +214,8 @@ def transform2(row):
214214

215215
msg = "'float' object has no attribute 'startswith'"
216216
with pytest.raises(AttributeError, match=msg):
217-
data.apply(transform, axis=1)
217+
with tm.assert_cow_warning(warn_copy_on_write):
218+
data.apply(transform, axis=1)
218219

219220

220221
@pytest.mark.parametrize(

pandas/tests/copy_view/test_constructors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ def test_dataframe_from_series_or_index(
297297
if using_copy_on_write:
298298
assert not df._mgr._has_no_reference(0)
299299

300-
# TODO(CoW-warn) should not warn for an index?
301300
with tm.assert_cow_warning(warn_copy_on_write):
302301
df.iloc[0, 0] = data[-1]
303302
if using_copy_on_write:

pandas/tests/copy_view/test_indexing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,6 @@ def test_del_frame(backend, using_copy_on_write, warn_copy_on_write):
913913
tm.assert_frame_equal(df2, df_orig[["a", "c"]])
914914
df2._mgr._verify_integrity()
915915

916-
# TODO(CoW-warn) false positive, this should not warn?
917916
with tm.assert_cow_warning(warn_copy_on_write and dtype_backend == "numpy"):
918917
df.loc[0, "b"] = 200
919918
assert np.shares_memory(get_array(df, "a"), get_array(df2, "a"))

0 commit comments

Comments
 (0)