Skip to content

Conversation

@nrnavaneet
Copy link

@nrnavaneet nrnavaneet commented Jul 13, 2025

This PR adds support for assigning values to specific fields in structured dtypes in Dask arrays (e.g., arr['f'] = 1.5), similar to NumPy behavior. Previously, this would silently fail or be unsupported.

Changes Made:

  • Updated setitem in dask/array/core.py to handle field-wise assignment.
  • Added test test_structured_field_assignment_works in dask/array/tests/test_array_core.py to validate behaviour and edge cases.

While running pre-commit, I encountered these mypy errors:
1. int is not iterable – dask/bag/core.py
2. .append() used on a NumPy array – dask/array/_array_expr/_shuffle.py
3. Encountered a deprecation warning from mypy: numpy.typing.mypy_plugin is deprecated.
4. Unused "type: ignore" – in dask/dataframe/tests/test_dataframe.py

Even though these are unrelated to my PR or changes, I've tried to fix them.

Fixes Applied:

  • Adjusted the type annotation logic and ensured lists were used where needed instead of NumPy arrays for compatibility.
  • These fixes ensure mypy passes cleanly without altering core logic or behaviour.
  • To resolve this, I removed the deprecated plugin from pyproject.toml.

Closes: [#12016]

@nrnavaneet
Copy link
Author

HI all,
I found a few mypy errros even though these are unrelated to my PR or changes, I've tried to fix them. If they are causing any issues or errors kindly lmk.
Thank you

@github-actions
Copy link
Contributor

github-actions bot commented Jul 13, 2025

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 24m 7s ⏱️ - 2m 38s
 18 041 tests +1   16 825 ✅ + 2   1 216 💤 ±0  0 ❌  - 1 
161 443 runs  +9  149 334 ✅ +11  12 109 💤  - 1  0 ❌  - 1 

Results for commit 3448cff. ± Comparison against base commit 3f6051a.

♻️ This comment has been updated with latest results.

@github-actions github-actions bot added the needs attention It's been a while since this was pushed on. Needs attention from the owner or a maintainer. label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs attention It's been a while since this was pushed on. Needs attention from the owner or a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant