Skip to content

Fix Client submit and map type hints - #9346

Open
nadzhou wants to merge 6 commits into
dask:mainfrom
nadzhou:an-add-type-hints
Open

Fix Client submit and map type hints#9346
nadzhou wants to merge 6 commits into
dask:mainfrom
nadzhou:an-add-type-hints

Conversation

@nadzhou

@nadzhou nadzhou commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Closes #xxxx

  • Tests added / passed
  • Passes pixi run lint

Fixes #8429

@nadzhou
nadzhou requested a review from fjetter as a code owner August 15, 2026 21:22
@nadzhou

nadzhou commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@fjetter I made the changes as per request but lint is throwing me errors now:

codespell................................................................Passed
  mypy.....................................................................Failed
  - hook id: mypy
  - exit code: 1
  
  distributed/client.py:2020: error: Arguments not allowed after ParamSpec.args  [valid-type]
  distributed/shuffle/tests/test_merge.py:27: error: Unused "type: ignore" comment  [unused-ignore]
  distributed/shuffle/tests/test_shuffle.py:80: error: Unused "type: ignore" comment  [unused-ignore]

@github-actions

github-actions Bot commented Aug 15, 2026

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.

    40 files  ±0      40 suites  ±0   14h 45m 8s ⏱️ +36s
 4 159 tests ±0   3 980 ✅ +1    178 💤 ±0  1 ❌  - 1 
80 940 runs  ±0  76 702 ✅ +1  4 237 💤 ±0  1 ❌  - 1 

For more details on these failures, see this check.

Results for commit 374a600. ± Comparison against base commit 40fcd99.

♻️ This comment has been updated with latest results.

@jonasdedden

Copy link
Copy Markdown
Contributor

Sorry for giving wrong suggestions in the issue some years ago, back then I lacked a bit of understanding around ParamSpec. I believe because submit and map introduce their own keyword parameters, one can't differentiate them from the Callable's ParamSpec.

That's why I mypy is complaining about the use of ParamSpec with other keyword arguments (P.args and P.kwargs have to be used directly besides each other) - I believe the only way put here is to just omit typehinting of args and kwargs. Then I'd say it would be sensible to reduce the scope of this PR to just removing the wrong tuple typehint in the docstring.

Just FYI, there are ways to fully typehint this, but they would require breaking changes to the submit and map function signature, as far as I can see.

@nadzhou

nadzhou commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Just FYI, there are ways to fully typehint this, but they would require breaking changes to the submit and map function signature, as far as I can see.

Yeah, we can wrap all other input arguemnts to *args, for example.

nadzhou and others added 3 commits August 15, 2026 16:17
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nadzhou

nadzhou commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@fjetter done now.

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.

Client.submit *args is typehinted wrongly

2 participants