Skip to content

Fix Array.setitem when both the array and the indexer have unknown shape - #11943

Merged
fjetter merged 3 commits into
dask:mainfrom
TomAugspurger:tom/setitem-nan-shape
May 13, 2025
Merged

fjetter merged 3 commits into
dask:mainfrom
TomAugspurger:tom/setitem-nan-shape

Conversation

@TomAugspurger

Copy link
Copy Markdown
Member

Closes #11753, specifically #11753 (comment)

@TomAugspurger
TomAugspurger force-pushed the tom/setitem-nan-shape branch from 1f745c9 to 50ae351 Compare May 10, 2025 14:31
@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.

      9 files  ± 0        9 suites  ±0   3h 23m 1s ⏱️ + 5m 12s
 18 032 tests + 4   16 816 ✅ + 2   1 216 💤 + 2  0 ❌ ±0 
161 362 runs  +36  149 229 ✅ +19  12 133 💤 +17  0 ❌ ±0 

Results for commit 4e6eba7. ± Comparison against base commit 7df5674.

@fjetter fjetter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That looks surprisingly simple! Thanks for looking into it

@fjetter
fjetter merged commit c2a7303 into dask:main May 13, 2025
@crusaderky crusaderky changed the title Fix Array.setitem with nan shapes on both sides Fix Array.setitem when both the array and the indexer have unknown shape May 15, 2025
@crusaderky

Copy link
Copy Markdown
Collaborator

Updated PR title and github changelog:

- Fix Array.setitem with nan shapes on both sides 
+ Fix Array.setitem when both the array and the indexer have unknown shape

It was very misleading, as a[mask] = b[mask] - an issue that plagues most users1 - still doesn't work.
The Sphinx changelog was already correct.

1 Namely, it's a major pain in scipy and there have been extensive hacks around it.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: cannot broadcast shape in Array.__setitem__ with boolean mask

3 participants