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

upload_fileobj types in S3Client are wrong. #218

Closed caner-cetin closed 1 year ago

caner-cetin commented 1 year ago
    def upload_fileobj(
        self,
        Fileobj: FileobjTypeDef,
        Bucket: str,
        Key: str,
        ExtraArgs: Dict[str, Any] = ...,
        Callback: Callable[..., Any] = ...,
        Config: TransferConfig = ...,
    ) -> None:

This function contradicts to

S3.Client.upload_fileobj(Fileobj, Bucket, Key, ExtraArgs=None, Callback=None, Config=None)

meaning ExtraArgs, Callback, Config is not optional in stub files, thus leading to errors. Latest version of stubs, boto3, everything.

vemel commented 1 year ago

Thank you for the report.

Yes, looks like this function is injected by boto3, so it should be manually annotated. I will release a fix this week.

vemel commented 1 year ago

Fix in the latest release. Please update to mypy-boto3-s3 1.28.27 and let me know if it works as it should.

caner-cetin commented 1 year ago

@vemel it works as expected now. thanks matey!