Skip to content

Commit

Permalink
Fix warnings for inplace ops
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Nov 26, 2023
1 parent b506bfb commit 2834bbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12450,7 +12450,7 @@ def _inplace_method(self, other, op) -> Self:
"""
warn = True
if not PYPY and warn_copy_on_write():
if sys.getrefcount(self) <= 4:
if sys.getrefcount(self) <= REF_COUNT * 2:
# we are probably in an inplace setitem context (e.g. df['a'] += 1)
warn = False

Expand Down

0 comments on commit 2834bbb

Please sign in to comment.