Skip to content

Client.register_plugin inferred as NoReturn #9176

Closed

Description

@moi90

Describe the issue: Because of the @singledispatchmethod Client._register_plugin (which unconditionally raises TypeError in the base implementation), pyright infers that Client.register_plugin (and therefore also Client.forward_logging) never return.

Minimal Complete Verifiable Example:

with Client() as client:
  client.forward_logging()

  # Inferred type:
  # (method) def forward_logging(
  #     logger_name: Unknown | None = None,
  #     level: int = logging.NOTSET
  # ) -> NoReturn


# Error: "Type analysis indicates code is unreachable"
...

Anything else we need to know?:

Environment:

dask               2025.4.1
dask-jobqueue      0.9.0
Python 3.13.7
  • Operating System: Rocky Linux 9
  • Install method (conda, pip, source): pip (uv)

Activity

  1. jacobtomlinson commented on Jan 20, 2026

    @jacobtomlinson
    Member

    Currently we only have mypy in our linting configuration here, we don't use pyright. If people want to make PRs to improve type hinting specifically for pyright I would be happy to review them, but I don't think it's something we would actively try and support.

  2. moi90 commented on Jan 20, 2026

    @moi90
    ContributorAuthor
  3. moi90 commented on Mar 3, 2026

    @moi90
    ContributorAuthor

    @jacobtomlinson It seems to be enough to add a return type annotation, see #9201.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions