Skip to content

Commit 4eaf840

Browse files
authored
CI: Add CoW builds and fix inplace warnings (#56173)
1 parent 368643f commit 4eaf840

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ jobs:
7373
env_file: actions-311.yaml
7474
pattern: "not slow and not network and not single_cpu"
7575
pandas_copy_on_write: "warn"
76+
- name: "Copy-on-Write 3.10 (warnings)"
77+
env_file: actions-310.yaml
78+
pattern: "not slow and not network and not single_cpu"
79+
pandas_copy_on_write: "warn"
80+
- name: "Copy-on-Write 3.9 (warnings)"
81+
env_file: actions-39.yaml
82+
pattern: "not slow and not network and not single_cpu"
83+
pandas_copy_on_write: "warn"
7684
- name: "Pypy"
7785
env_file: actions-pypy-39.yaml
7886
pattern: "not slow and not network and not single_cpu"

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12450,7 +12450,7 @@ def _inplace_method(self, other, op) -> Self:
1245012450
"""
1245112451
warn = True
1245212452
if not PYPY and warn_copy_on_write():
12453-
if sys.getrefcount(self) <= 4:
12453+
if sys.getrefcount(self) <= REF_COUNT + 2:
1245412454
# we are probably in an inplace setitem context (e.g. df['a'] += 1)
1245512455
warn = False
1245612456

0 commit comments

Comments
 (0)