mypy_boto3_builder: aioboto3: session.client shows "type is partually unknown" in VSCode

from aioboto3 import Session

session = Session()
async with session.client(service_name='s3') as s3:
    print(s3)

  1. Install aioboto3, types-aioboto3[essential], types-aiobotocore[essential], types-aiobotocore-support
  2. Run pylance on the above code sample

Actual output

Warning from pylance: type of “client” is partially unknown

Expected output

No warnings

Additional context MacOS, recent versions of aioboto3 and other libs. “strict” mode of pylance.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 18

Most upvoted comments

Thanks, yes that’s what I thought, I’m essentially doing this:

  # pyright: ignore[reportUnknownMemberType]

Thanks for the investigation! I’m closing this issue, however I will probably create related issue for pyright.

I will check again. For some reason, pylance does not use types-aiobotocore annotations.