@@ -42,7 +42,7 @@ def execute_dag(
4242 callbacks : Optional [Sequence [Callback ]] = None ,
4343 spec : Optional [Spec ] = None ,
4444 compute_id : Optional [str ] = None ,
45- ** kwargs ,
45+ ** kwargs : Any ,
4646 ) -> None :
4747 for name , node in visit_nodes (dag ):
4848 handle_operation_start_callbacks (callbacks , name )
@@ -57,7 +57,8 @@ def execute_dag(
5757 )
5858 if callbacks is not None :
5959 event = TaskEndEvent (name = name , result = result )
60- [callback .on_task_end (event ) for callback in callbacks ]
60+ for callback in callbacks :
61+ callback .on_task_end (event )
6162 handle_operation_end_callbacks (callbacks , name )
6263
6364
@@ -81,7 +82,7 @@ def unpickle_and_call(f, inp, **kwargs):
8182 return f (inp , ** kwargs )
8283
8384
84- def check_runtime_memory (spec , max_workers ) :
85+ def check_runtime_memory (spec : Optional [ Spec ] , max_workers : int ) -> None :
8586 allowed_mem = spec .allowed_mem if spec is not None else None
8687 total_mem = psutil .virtual_memory ().total
8788 if allowed_mem is not None :
@@ -113,7 +114,7 @@ def create_futures_func(input, **kwargs):
113114class ThreadsExecutor (DagExecutor ):
114115 """An execution engine that uses Python asyncio."""
115116
116- def __init__ (self , ** kwargs ) :
117+ def __init__ (self , ** kwargs : Any ) -> None :
117118 super ().__init__ (** kwargs )
118119
119120 # Tell NumPy to use a single thread
@@ -133,7 +134,7 @@ def execute_dag(
133134 callbacks : Optional [Sequence [Callback ]] = None ,
134135 spec : Optional [Spec ] = None ,
135136 compute_id : Optional [str ] = None ,
136- ** kwargs ,
137+ ** kwargs : Any ,
137138 ) -> None :
138139 merged_kwargs = {** self .kwargs , ** kwargs }
139140 asyncio_run (
@@ -152,7 +153,7 @@ async def _async_execute_dag(
152153 callbacks : Optional [Sequence [Callback ]] = None ,
153154 spec : Optional [Spec ] = None ,
154155 compute_arrays_in_parallel : Optional [bool ] = None ,
155- ** kwargs ,
156+ ** kwargs : Any ,
156157 ) -> None :
157158 max_workers = kwargs .pop ("max_workers" , os .cpu_count ())
158159 if spec is not None :
@@ -203,7 +204,7 @@ def create_futures_func(input, **kwargs):
203204class ProcessesExecutor (DagExecutor ):
204205 """An execution engine that uses local processes."""
205206
206- def __init__ (self , ** kwargs ) :
207+ def __init__ (self , ** kwargs : Any ) -> None :
207208 super ().__init__ (** kwargs )
208209
209210 # Tell NumPy to use a single thread
@@ -223,7 +224,7 @@ def execute_dag(
223224 callbacks : Optional [Sequence [Callback ]] = None ,
224225 spec : Optional [Spec ] = None ,
225226 compute_id : Optional [str ] = None ,
226- ** kwargs ,
227+ ** kwargs : Any ,
227228 ) -> None :
228229 merged_kwargs = {** self .kwargs , ** kwargs }
229230 asyncio_run (
@@ -242,7 +243,7 @@ async def _async_execute_dag(
242243 callbacks : Optional [Sequence [Callback ]] = None ,
243244 spec : Optional [Spec ] = None ,
244245 compute_arrays_in_parallel : Optional [bool ] = None ,
245- ** kwargs ,
246+ ** kwargs : Any ,
246247 ) -> None :
247248 max_workers = kwargs .pop ("max_workers" , os .cpu_count ())
248249 if spec is not None :
0 commit comments