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

Too many arguments on the Message class are marked as Awaitable #171

Closed johman10 closed 1 year ago

johman10 commented 2 years ago

Describe the bug After the fix on issue https://github.com/youtype/mypy_boto3_builder/issues/168, it seems like there are some attributes that are marked as awaitable, while they shouldn't be.

This goes for receipt_handle and queue_url. I wrote some code that proved that those are the only Awaitables.

To Reproduce Steps to reproduce the behavior:

  1. Install types-aiobotocore[essential]@2.4.0.post1
  2. Run mypy on the following code sample
from types_aiobotocore_sqs.service_resource import Message

async def process_message(message: Message):
    handle = message.receipt_handle  # this is correct code
    queue_url = message.queue_url  # this is correct code

Actual output

error: Incompatible types (expression has type "Awaitable[str]", TypedDict item "ReceiptHandle" has type "str")

Expected output No errors

Additional context Linux aioboto3@10.1.0 Poetry

vemel commented 2 years ago

Hello. Thank you for the report.

I will try to find a way to unmark non-awaitable attributes.

vemel commented 1 year ago

Finally, it is fixed in types-aiobotocore 2.4.2.post2. Please test it and let me know if it works as it should.

I checked aioboto3 code and found out that only non-identifier and non-reference attributes are Awaitable.

johman10 commented 1 year ago

@vemel it seems to be working! Thanks a lot for the support. Closing the issue now.