Skip to content

Client.register_plugin inferred as NoReturn #9176

@moi90

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)

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