Closed chen2073 closed 1 year ago
Hello!
In your example s3_client
has type boto3.client.BaseClient
in runtime. S3Client
can be used only during type checking.
You can check client service name in runtime using
from boto3.session import Session
from mypy_boto3_s3.client import S3Client
s3_client = Session().client("s3")
s3_client.meta.service_model.service_name == "s3"
Please let me know if this helps.
Thank you for the response, I will give it a try
Describe the bug I have boto3 type stubs installed and initialized a S3 client, I tried assigning this s3 client to pydantic BaseSettings and it failed validation where s3_client is not a S3Client
To Reproduce Steps to reproduce the behavior:
boto3-stubs[all]