@@ -121,17 +121,18 @@ def _find_by_worker_host(
121121 return next (iter (filtered_workers .items ()))
122122
123123
124- class DaskClusterTasks (TypedDict ):
124+ class _DaskClusterTasks (TypedDict ):
125125 processing : dict [DaskWorkerUrl , list [tuple [dask .typing .Key , DaskTaskResources ]]]
126126 unrunnable : dict [dask .typing .Key , DaskTaskResources ]
127127
128128
129129async def _list_cluster_known_tasks (
130130 client : distributed .Client ,
131- ) -> DaskClusterTasks :
131+ ) -> _DaskClusterTasks :
132132 def _list_on_scheduler (
133133 dask_scheduler : distributed .Scheduler ,
134- ) -> DaskClusterTasks :
134+ ) -> _DaskClusterTasks :
135+
135136 worker_to_processing_tasks = defaultdict (list )
136137 unrunnable_tasks = {}
137138 for task_key , task_state in dask_scheduler .tasks .items ():
@@ -148,12 +149,12 @@ def _list_on_scheduler(
148149 task_state .resource_restrictions or {}
149150 ) | {DASK_WORKER_THREAD_RESOURCE_NAME : 1 }
150151
151- return DaskClusterTasks (
152+ return _DaskClusterTasks (
152153 processing = worker_to_processing_tasks , # type: ignore[typeddict-item]
153154 unrunnable = unrunnable_tasks , # type: ignore[typeddict-item]
154155 )
155156
156- list_of_tasks : DaskClusterTasks = await client .run_on_scheduler (_list_on_scheduler )
157+ list_of_tasks : _DaskClusterTasks = await client .run_on_scheduler (_list_on_scheduler )
157158 _logger .debug ("found tasks: %s" , list_of_tasks )
158159
159160 return list_of_tasks
0 commit comments