Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC2 InstanceTypeDef.Platform Literal incorrectly capitalized #245

Closed
andrew-womeldorf opened this issue Feb 9, 2024 · 6 comments
Closed
Assignees
Labels
🐞 bug Something isn't working 🎉 released Changes were included to the latest release 👋 response needed Awaiting response from a reporter

Comments

@andrew-womeldorf
Copy link

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, not Windows. This matches what we're receiving in practice (the lowercased version).

To Reproduce
Steps to reproduce the behavior:

  1. Install boto3-stubs[...]
  2. 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

@andrew-womeldorf andrew-womeldorf added the 🐞 bug Something isn't working label Feb 9, 2024
@vemel
Copy link
Collaborator

vemel commented Feb 27, 2024

Hello! Thank you for the report.

Looks like it is because of a mistake in botocore shapes. I will cross-check all dependent methods and stub this enum if it is safe to do.

@vemel
Copy link
Collaborator

vemel commented Feb 27, 2024

@andrew-womeldorf
Copy link
Author

Oooo, that's irritating. I wonder if it's worthwhile to accept either casing

@vemel
Copy link
Collaborator

vemel commented Feb 27, 2024

I created a bug report: boto/botocore#3128

No, looks like it is always windows, so I am going to temporarily stub this value until the bug is fixed.

@vemel
Copy link
Collaborator

vemel commented Feb 27, 2024

@andrew-womeldorf fixed in mypy-boto3-ec2 1.34.50. Please update and let me know if it works as it should.

@vemel vemel added 👋 response needed Awaiting response from a reporter 🎉 released Changes were included to the latest release labels Feb 27, 2024
@vemel vemel self-assigned this Feb 27, 2024
@andrew-womeldorf
Copy link
Author

Fixed! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🎉 released Changes were included to the latest release 👋 response needed Awaiting response from a reporter
2 participants