Skip to content

Commit

Permalink
Avoid multiple WorkerState sphinx error
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau committed May 7, 2024
1 parent d5edb4e commit 037176e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions distributed/diagnostics/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@

if TYPE_CHECKING:
# circular imports
# Needed to avoid Sphinx WARNING: more than one target found for cross-reference
# 'WorkerState'"
# https://github.com/agronholm/sphinx-autodoc-typehints#dealing-with-circular-imports
from distributed import scheduler as scheduler_module
from distributed.scheduler import Scheduler
from distributed.scheduler import TaskStateState as SchedulerTaskStateState
from distributed.scheduler import WorkerState
from distributed.worker import Worker
from distributed.worker_state_machine import TaskStateState as WorkerTaskStateState

Expand Down Expand Up @@ -207,8 +210,8 @@ def remove_client(self, scheduler: Scheduler, client: str) -> None:
"""Run when a client disconnects"""

def valid_workers_downscaling(
self, scheduler: Scheduler, workers: list[WorkerState]
) -> list[WorkerState]:
self, scheduler: Scheduler, workers: list[scheduler_module.WorkerState]
) -> list[scheduler_module.WorkerState]:
"""Determine which workers can be removed from the cluster
This method is called when the scheduler is about to downscale the cluster
Expand Down

0 comments on commit 037176e

Please sign in to comment.