Skip to content

Update map_meta test#12243

Merged
jacobtomlinson merged 1 commit intodask:mainfrom
TomAugspurger:tom/pandas-3-map-meta-fix
Jan 22, 2026
Merged

Update map_meta test#12243
jacobtomlinson merged 1 commit intodask:mainfrom
TomAugspurger:tom/pandas-3-map-meta-fix

Conversation

@TomAugspurger
Copy link
Copy Markdown
Member

With pandas 3.x, the behavior of this test changed, probably related to copy-on-write, so that mutating

expected = pdf.x.map(lambda x: x + 1)
pdf.index.name = "a"

no longer mutated expected.index.name.

This updates the test to recompute expected after modifying the index.

Closes #12225
Closes #12203

With pandas 3.x, the behavior of this test changed, probably
related to copy-on-write, so that mutating

```
expected = pdf.x.map(lambda x: x + 1)
pdf.index.name = "a"
```

no longer mutated `expected.index.name`.

This updates the test to recompute `expected` after modifying
the index.
Copy link
Copy Markdown
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks @TomAugspurger I was just about to look at this.

RTD failures are unrelated and fixed in #12242

@github-actions
Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 905c3fd. ± Comparison against base commit 461c540.

@TomAugspurger
Copy link
Copy Markdown
Member Author

I can't reproduce the windows failure, but push a commit that tries to fix it. Hopefully we just need to use the appropriate size somewhere

>       assert_attr_equal("dtype", left, right, obj=obj)
E       AssertionError: DataFrame.index are different
E       
E       Attribute "dtype" are different
E       [left]:  int64
E       [right]: int32

@jacobtomlinson
Copy link
Copy Markdown
Member

Still there unfortunately

@jacobtomlinson
Copy link
Copy Markdown
Member

The test_merge_groupby_to_frame failure on Windows with Python 3.14 feels unrelated to this PR so I'm going to merge this and we can handle it in a follow on PR.

@jacobtomlinson jacobtomlinson merged commit bb7137d into dask:main Jan 22, 2026
24 of 27 checks passed
@nullr0ute
Copy link
Copy Markdown

This fixed the build on Fedora against pandas3 for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pandas 3 test failures ⚠️ Upstream CI failed ⚠️

3 participants