youtype / mypy_boto3_builder

Type annotations builder for boto3 compatible with VSCode, PyCharm, Emacs, Sublime Text, pyright and mypy.
https://youtype.github.io/mypy_boto3_builder/
MIT License
544 stars 36 forks source link

ResponseMetadata attribute being added to EC2 TypeDefs where it doesn't belong #244

Closed andrew-womeldorf closed 7 months ago

andrew-womeldorf commented 7 months ago

Describe the bug ResponseMetadata is being added to the EC2 StateReasonTypeDef, but it shouldn't be there as far as I can tell.

To Reproduce Steps to reproduce the behavior:

  1. Install boto3-stubs[ec2]
  2. Run mypy/pyright on the following code sample
from mypy_boto3_ec2.type_defs import StateReasonTypeDef
reason: StateReasonTypeDef = {"Code": "0", "Message": "test"}

Actual output

$ poetry run pyright
<path>/main.py
  <path>/main.py:2:30 - error: Expression of type "dict[str, str]" cannot be assigned to declared type "StateReasonTypeDef"
    "ResponseMetadata" is required in "StateReasonTypeDef" (reportAssignmentType)
1 error, 0 warnings, 0 informations

Additional context Your OS, boto3-stubs installation method, boto3 version, etc.

boto3-stubs 1.34.38

vemel commented 7 months ago

Hello!

Thank you for the bug report.

Sorry for the late response. I have finally found the issue when clashing type annotations were not renamed correctly. I am going to release a new version today or tomorrow.

andrew-womeldorf commented 7 months ago

No worries! Thank you for the response. Looking forward to removing my local overrides :)

vemel commented 7 months ago

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

This fix affects other services as well, so that was a good find. Thank you a lot!

andrew-womeldorf commented 7 months ago

Fixed! Thank you very much!