Skip to content

Commit

Permalink
CoW: Remove todos that aren't necessary (#56169)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Nov 27, 2023
1 parent 13bdca4 commit 4c520e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pandas/tests/apply/test_invalid_arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_transform_axis_1_raises():

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

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


@pytest.mark.parametrize(
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/copy_view/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ def test_dataframe_from_series_or_index(
if using_copy_on_write:
assert not df._mgr._has_no_reference(0)

# TODO(CoW-warn) should not warn for an index?
with tm.assert_cow_warning(warn_copy_on_write):
df.iloc[0, 0] = data[-1]
if using_copy_on_write:
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/copy_view/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,6 @@ def test_del_frame(backend, using_copy_on_write, warn_copy_on_write):
tm.assert_frame_equal(df2, df_orig[["a", "c"]])
df2._mgr._verify_integrity()

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

0 comments on commit 4c520e3

Please sign in to comment.