@@ -343,10 +343,10 @@ async def _sorted_allowed_instance_types(app: FastAPI) -> list[EC2InstanceType]:
343343 allowed_instance_type_names
344344 ), "EC2_INSTANCES_ALLOWED_TYPES cannot be empty!"
345345
346- allowed_instance_types : list [EC2InstanceType ] = (
347- await ec2_client . get_ec2_instance_capabilities (
348- cast ( set [ InstanceTypeType ], set ( allowed_instance_type_names ))
349- )
346+ allowed_instance_types : list [
347+ EC2InstanceType
348+ ] = await ec2_client . get_ec2_instance_capabilities (
349+ cast ( set [ InstanceTypeType ], set ( allowed_instance_type_names ) )
350350 )
351351
352352 def _as_selection (instance_type : EC2InstanceType ) -> int :
@@ -844,7 +844,7 @@ async def _launch_instances(
844844 elif isinstance (r , list ):
845845 new_pending_instances .extend (r )
846846 else :
847- new_pending_instances .append (r )
847+ new_pending_instances .append (r ) # type: ignore[unreachable]
848848
849849 log_message = (
850850 f"{ sum (n for n in capped_needed_machines .values ())} new machines launched"
@@ -1078,9 +1078,9 @@ async def _notify_based_on_machine_type(
10781078 launch_time_to_tasks : dict [datetime .datetime , list ] = collections .defaultdict (list )
10791079 now = datetime .datetime .now (datetime .UTC )
10801080 for instance in instances :
1081- launch_time_to_tasks [
1082- instance .ec2_instance . launch_time
1083- ] += instance . assigned_tasks
1081+ launch_time_to_tasks [instance . ec2_instance . launch_time ] += (
1082+ instance .assigned_tasks
1083+ )
10841084
10851085 for launch_time , tasks in launch_time_to_tasks .items ():
10861086 time_since_launch = now - launch_time
0 commit comments