Skip to content

Commit 4be616a

Browse files
committed
pyright
1 parent 3b9b587 commit 4be616a

File tree

1 file changed

+11
-3
lines changed
  • packages/aws-library/src/aws_library/ec2

1 file changed

+11
-3
lines changed

packages/aws-library/src/aws_library/ec2/_client.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,17 @@ async def launch_instances(
173173
)
174174
assert "Subnets" in subnets # nosec
175175
subnet_id_to_subnet_map: dict[str, SubnetTypeDef] = {
176-
subnet["SubnetId"]: subnet for subnet in subnets["Subnets"]
176+
subnet[
177+
"SubnetId"
178+
]: subnet # pyright: ignore[reportTypedDictNotRequiredAccess]
179+
for subnet in subnets["Subnets"]
177180
}
178181
# preserve the order of instance_config.subnet_ids
179182

180183
subnet_id_to_available_ips: dict[str, int] = {
181-
subnet_id: subnet_id_to_subnet_map[subnet_id]["AvailableIpAddressCount"] # type: ignore
184+
subnet_id: subnet_id_to_subnet_map[subnet_id][
185+
"AvailableIpAddressCount"
186+
] # pyright: ignore[reportTypedDictNotRequiredAccess]
182187
for subnet_id in instance_config.subnet_ids
183188
}
184189

@@ -264,7 +269,10 @@ async def launch_instances(
264269
subnet_ids=instance_config.subnet_ids,
265270
instance_type=instance_config.type.name,
266271
)
267-
instance_ids = [i["InstanceId"] for i in instances["Instances"]]
272+
instance_ids = [
273+
i["InstanceId"] # pyright: ignore[reportTypedDictNotRequiredAccess]
274+
for i in instances["Instances"]
275+
]
268276
with log_context(
269277
_logger,
270278
logging.INFO,

0 commit comments

Comments
 (0)