Skip to content

Commit 6464472

Browse files
author
Mayank
committed
Add 100-word report for GH#62787; fix line endings via pre-commit
1 parent c8d2ea0 commit 6464472

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

REPORT_62787_100W.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# GH#62787: CoW replace with dict containing np.nan
2+
3+
Issue: With Copy-on-Write enabled, DataFrame.replace({np.nan: ...}) via dict raised ValueError about a weakref not in list. Root cause was in Block.replace_list CoW cleanup: dead weakrefs (b() is None) were included in the referenced_blocks lookup, leading to invalid pops during multi-step replace.
4+
5+
Fix: In core/internals/blocks.py, build the self_blk_ids map only from live weakrefs:
6+
7+
- Skip entries where b() is None.
8+
- Preserve existing CoW semantics; no API change.
9+
10+
Tests: Added tests covering dict replacements with np.nan/NA/NaT, Series behavior, inplace, mixed dtypes, nested dicts, chaining, and CoW vs non-CoW parity.
11+
12+
Result: Pre-commit clean; CI expected to pass.

0 commit comments

Comments
 (0)