-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
BUG: DataFrame._item_cache not cleared on on .copy() #33299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2ae7656
de867c0
d2b9181
441a3e0
dfc63dc
f1bafef
0dc971a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -910,3 +910,21 @@ def test_axis_classmethods(self, box): | |
| assert obj._get_axis_number(v) == box._get_axis_number(v) | ||
| assert obj._get_axis_name(v) == box._get_axis_name(v) | ||
| assert obj._get_block_manager_axis(v) == box._get_block_manager_axis(v) | ||
|
|
||
| def test_cache_on_copy(self): | ||
|
||
| df = DataFrame({"a": [1]}) | ||
|
|
||
| df["x"] = [0] | ||
| df["a"] | ||
|
|
||
| df.copy() | ||
|
|
||
| df["a"].values[0] = -1 | ||
|
|
||
| assert df["a"].values[0] == -1 | ||
| tm.assert_frame_equal(df, DataFrame({"a": [-1], "x": [0]})) | ||
|
|
||
| df["y"] = 0 | ||
|
|
||
| assert df["a"].values[0] == -1 | ||
| tm.assert_frame_equal(df, DataFrame({"a": [-1], "x": [0], "y": [0]})) | ||
Uh oh!
There was an error while loading. Please reload this page.