Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types_aiobotocore_s3 erroneously contains upload_file (a boto3-only function) #345

Open
followben opened this issue Jan 24, 2025 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@followben
Copy link

Describe the bug
As per this answer, the S3 upload_file operation is not part of aiobotocore, nor botocore. However it is included in the types_aiobotocore_s3 and documentation, so only fails at runtime rather than during static analysis

To Reproduce
Steps to reproduce the behavior:

  1. Install types-aiobotocore
  2. Run mypy/pyright on the following code sample
from aiobotocore.session import get_session as get_boto_session
import tempfile
from types_aiobotocore_s3 import S3Client

async with get_boto_session().create_client("s3") as s3_client:
    with tempfile.NamedTemporaryFile(suffix=".txt") as tmp:
        await s3_client.upload_file(tmp.name, ""my-bucket", "my-file-key.txt")
...

Actual output

No error

Expected output

A type error along the lines of the error at runtime, e.g. 'S3' object has no attribute 'upload_file' 

Additional context
macos sequoia, types-aiobotocore v2.18.0, aiobotocore v2.18.0

@followben followben added the 🐞 bug Something isn't working label Jan 24, 2025
@vemel
Copy link
Collaborator

vemel commented Jan 26, 2025

Hello.

Thank you for your report. types-aiobotocore-s3 includes type annotations for both botocore and boto3. Probably I can separate botocore.BaseClient and boto3.Client annotations. I will check if this can be done this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants