mypy_boto3_builder
mypy_boto3_builder copied to clipboard
EC2 InstanceTypeDef.Platform Literal incorrectly capitalized
Describe the bug
EC2 InstanceTypeDef
- the Platform field is typed NotRequired[Literal["Windows"]]
, which is so close to being correct it hurts that it's not 😂
-
AWS Docs indicate that it's
windows
, notWindows
. This matches what we're receiving in practice (the lowercased version).
To Reproduce Steps to reproduce the behavior:
- Install
boto3-stubs[...]
- Run
mypy
/pyright
on the following code sample
from mypy_boto3_ec2.type_defs import InstanceTypeDef
instance: InstanceTypeDef = {"Platform": "windows"}
Actual output
$ poetry run pyright
<path>/main.py
<path>/main.py:2:42 - error: Expression of type "dict[str, str]" cannot be assigned to declared type "InstanceTypeDef"
"Literal['windows']" cannot be assigned to type "Literal['Windows']" (reportAssignmentType)
1 error, 0 warnings, 0 informations
Additional context
Your OS, boto3-stubs
installation method, boto3
version, etc.
boto3-stubs 1.34.38