diff --git a/integration/types_aioboto3/mypy/s3_example.py.out b/integration/types_aioboto3/mypy/s3_example.py.out index 95a618aa..377a5942 100644 --- a/integration/types_aioboto3/mypy/s3_example.py.out +++ b/integration/types_aioboto3/mypy/s3_example.py.out @@ -1,29 +1,29 @@ -integration/types_aioboto3/s3_example.py:37: error: Incompatible types in assignment (expression has type "Coroutine[Any, Any, Bucket]", variable has type "Bucket") [assignment] -integration/types_aioboto3/s3_example.py:37: note: Maybe you forgot to use "await"? -integration/types_aioboto3/s3_example.py:38: error: Unexpected keyword argument "mfa" for "delete" of "BucketObjectsCollection" [call-arg] -integration/types_aioboto3/s3_example.py:41: error: Argument "Key" to "upload_file" of "Bucket" has incompatible type "int"; expected "str" [arg-type] -integration/types_aioboto3/s3_example.py:41: error: Argument "Config" to "upload_file" of "Bucket" has incompatible type "str"; expected "TransferConfig | None" [arg-type] -integration/types_aioboto3/s3_example.py:42: error: Missing key "Key" for TypedDict "BucketUploadFileRequestTypeDef" [typeddict-item] -integration/types_aioboto3/s3_example.py:42: error: Extra key "key" for TypedDict "BucketUploadFileRequestTypeDef" [typeddict-unknown-key] -integration/types_aioboto3/s3_example.py:46: error: Missing key "Key" for TypedDict "CopySourceTypeDef" [typeddict-item] -integration/types_aioboto3/s3_example.py:46: error: Extra key "key" for TypedDict "CopySourceTypeDef" [typeddict-unknown-key] -integration/types_aioboto3/s3_example.py:54: error: Argument "CopySource" to "copy_from" of "ObjectSummary" has incompatible type "int"; expected "str | CopySourceTypeDef" [arg-type] -integration/types_aioboto3/s3_example.py:58: error: Argument "RequestPayer" to "abort" of "MultipartUpload" has incompatible type "Literal['none']"; expected "Literal['requester']" [arg-type] -integration/types_aioboto3/s3_example.py:59: error: Argument 1 to "Part" of "MultipartUpload" has incompatible type "str"; expected "int" [arg-type] -integration/types_aioboto3/s3_example.py:60: error: Unexpected keyword argument "wrong_arg" for "delete" of "Bucket" [call-arg] -integration/types_aioboto3/s3_example.py:60: error: Value of type "Coroutine[Any, Any, None]" must be used [unused-coroutine] -integration/types_aioboto3/s3_example.py:60: note: Are you missing an await? -integration/types_aioboto3/s3_example.py:76: error: Argument 3 to "download_fileobj" of "S3Client" has incompatible type "bytes"; expected "IO[Any] | StreamingBody" [arg-type] -integration/types_aioboto3/s3_example.py:77: error: Argument "IfModifiedSince" to "get_object" of "S3Client" has incompatible type "None"; expected "datetime | str" [arg-type] -integration/types_aioboto3/s3_example.py:80: error: Unexpected keyword argument "bucket" for "wait" of "BucketExistsWaiter"; did you mean "Bucket"? [call-arg] -integration/types_aioboto3/s3_example.py:84: error: Value of type "Coroutine[Any, Any, CreateBucketOutputTypeDef]" is not indexable [index] -integration/types_aioboto3/s3_example.py:84: note: Maybe you forgot to use "await"? -integration/types_aioboto3/s3_example.py:87: error: Missing named argument "Key" for "get_object" of "S3Client" [call-arg] -integration/types_aioboto3/s3_example.py:90: error: TypedDict "GetObjectOutputTypeDef" has no key "expiration" [typeddict-item] -integration/types_aioboto3/s3_example.py:90: note: Did you mean "Expiration"? -integration/types_aioboto3/s3_example.py:97: error: Missing key "AllowedOrigins" for TypedDict "CORSRuleTypeDef" [typeddict-item] -integration/types_aioboto3/s3_example.py:97: error: Extra key "Allowedorigins" for TypedDict "CORSRuleTypeDef" [typeddict-unknown-key] -integration/types_aioboto3/s3_example.py:104: error: Argument "Key" to "get_object" of "S3Client" has incompatible type "None"; expected "str" [arg-type] -integration/types_aioboto3/s3_example.py:106: error: "ClientError" has no attribute "operations_name"; maybe "operation_name"? [attr-defined] -integration/types_aioboto3/s3_example.py:110: error: "AsyncIterator[bytes]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable) [attr-defined] +integration/types_aioboto3/s3_example.py:36: error: Incompatible types in assignment (expression has type "Coroutine[Any, Any, Bucket]", variable has type "Bucket") [assignment] +integration/types_aioboto3/s3_example.py:36: note: Maybe you forgot to use "await"? +integration/types_aioboto3/s3_example.py:37: error: Unexpected keyword argument "mfa" for "delete" of "BucketObjectsCollection" [call-arg] +integration/types_aioboto3/s3_example.py:40: error: Argument "Key" to "upload_file" of "Bucket" has incompatible type "int"; expected "str" [arg-type] +integration/types_aioboto3/s3_example.py:40: error: Argument "Config" to "upload_file" of "Bucket" has incompatible type "str"; expected "TransferConfig | None" [arg-type] +integration/types_aioboto3/s3_example.py:41: error: Missing key "Key" for TypedDict "BucketUploadFileRequestTypeDef" [typeddict-item] +integration/types_aioboto3/s3_example.py:41: error: Extra key "key" for TypedDict "BucketUploadFileRequestTypeDef" [typeddict-unknown-key] +integration/types_aioboto3/s3_example.py:45: error: Missing key "Key" for TypedDict "CopySourceTypeDef" [typeddict-item] +integration/types_aioboto3/s3_example.py:45: error: Extra key "key" for TypedDict "CopySourceTypeDef" [typeddict-unknown-key] +integration/types_aioboto3/s3_example.py:53: error: Argument "CopySource" to "copy_from" of "ObjectSummary" has incompatible type "int"; expected "str | CopySourceTypeDef" [arg-type] +integration/types_aioboto3/s3_example.py:57: error: Argument "RequestPayer" to "abort" of "MultipartUpload" has incompatible type "Literal['none']"; expected "Literal['requester']" [arg-type] +integration/types_aioboto3/s3_example.py:58: error: Argument 1 to "Part" of "MultipartUpload" has incompatible type "str"; expected "int" [arg-type] +integration/types_aioboto3/s3_example.py:59: error: Unexpected keyword argument "wrong_arg" for "delete" of "Bucket" [call-arg] +integration/types_aioboto3/s3_example.py:59: error: Value of type "Coroutine[Any, Any, None]" must be used [unused-coroutine] +integration/types_aioboto3/s3_example.py:59: note: Are you missing an await? +integration/types_aioboto3/s3_example.py:75: error: Argument 3 to "download_fileobj" of "S3Client" has incompatible type "bytes"; expected "IO[Any] | StreamingBody" [arg-type] +integration/types_aioboto3/s3_example.py:76: error: Argument "IfModifiedSince" to "get_object" of "S3Client" has incompatible type "None"; expected "datetime | str" [arg-type] +integration/types_aioboto3/s3_example.py:79: error: Unexpected keyword argument "bucket" for "wait" of "BucketExistsWaiter"; did you mean "Bucket"? [call-arg] +integration/types_aioboto3/s3_example.py:83: error: Value of type "Coroutine[Any, Any, CreateBucketOutputTypeDef]" is not indexable [index] +integration/types_aioboto3/s3_example.py:83: note: Maybe you forgot to use "await"? +integration/types_aioboto3/s3_example.py:86: error: Missing named argument "Key" for "get_object" of "S3Client" [call-arg] +integration/types_aioboto3/s3_example.py:89: error: TypedDict "GetObjectOutputTypeDef" has no key "expiration" [typeddict-item] +integration/types_aioboto3/s3_example.py:89: note: Did you mean "Expiration"? +integration/types_aioboto3/s3_example.py:96: error: Missing key "AllowedOrigins" for TypedDict "CORSRuleTypeDef" [typeddict-item] +integration/types_aioboto3/s3_example.py:96: error: Extra key "Allowedorigins" for TypedDict "CORSRuleTypeDef" [typeddict-unknown-key] +integration/types_aioboto3/s3_example.py:103: error: Argument "Key" to "get_object" of "S3Client" has incompatible type "None"; expected "str" [arg-type] +integration/types_aioboto3/s3_example.py:105: error: "ClientError" has no attribute "operations_name"; maybe "operation_name"? [attr-defined] +integration/types_aioboto3/s3_example.py:109: error: "AsyncIterator[bytes]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable) [attr-defined] Found 24 errors in 1 file (checked 1 source file) \ No newline at end of file diff --git a/integration/types_aioboto3/pyright/s3_example.py.json b/integration/types_aioboto3/pyright/s3_example.py.json index f0880ae9..c378965b 100644 --- a/integration/types_aioboto3/pyright/s3_example.py.json +++ b/integration/types_aioboto3/pyright/s3_example.py.json @@ -4,11 +4,11 @@ "message": "Type \"Coroutine[Any, Any, _Bucket]\" is not assignable to declared type \"Bucket\"\n\u00a0\u00a0\"Coroutine[Any, Any, _Bucket]\" is not assignable to \"Bucket\"", "range": { "start": { - "line": 36, + "line": 35, "character": 25 }, "end": { - "line": 36, + "line": 35, "character": 50 } }, @@ -19,11 +19,11 @@ "message": "No parameter named \"mfa\"", "range": { "start": { - "line": 37, + "line": 36, "character": 36 }, "end": { - "line": 37, + "line": 36, "character": 39 } }, @@ -34,11 +34,11 @@ "message": "Argument of type \"Literal[123]\" cannot be assigned to parameter \"Key\" of type \"str\" in function \"upload_file\"\n\u00a0\u00a0\"Literal[123]\" is not assignable to \"str\"", "range": { "start": { - "line": 40, + "line": 39, "character": 56 }, "end": { - "line": 40, + "line": 39, "character": 59 } }, @@ -49,11 +49,11 @@ "message": "Argument of type \"Literal['test']\" cannot be assigned to parameter \"Config\" of type \"TransferConfig | None\" in function \"upload_file\"\n\u00a0\u00a0Type \"Literal['test']\" is not assignable to type \"TransferConfig | None\"\n\u00a0\u00a0\u00a0\u00a0\"Literal['test']\" is not assignable to \"TransferConfig\"\n\u00a0\u00a0\u00a0\u00a0\"Literal['test']\" is not assignable to \"None\"", "range": { "start": { - "line": 40, + "line": 39, "character": 68 }, "end": { - "line": 40, + "line": 39, "character": 74 } }, @@ -64,11 +64,11 @@ "message": "Type \"dict[str, str]\" is not assignable to declared type \"BucketUploadFileRequestTypeDef\"\n\u00a0\u00a0\"key\" is an undefined item in type \"BucketUploadFileRequestTypeDef\"", "range": { "start": { - "line": 41, + "line": 40, "character": 70 }, "end": { - "line": 41, + "line": 40, "character": 75 } }, @@ -79,11 +79,11 @@ "message": "Argument of type \"dict[str, str]\" cannot be assigned to parameter \"CopySource\" of type \"CopySourceTypeDef\" in function \"copy\"\n\u00a0\u00a0\"key\" is an undefined item in type \"CopySourceTypeDef\"", "range": { "start": { - "line": 45, + "line": 44, "character": 47 }, "end": { - "line": 45, + "line": 44, "character": 52 } }, @@ -94,11 +94,11 @@ "message": "Argument of type \"Literal[123]\" cannot be assigned to parameter \"CopySource\" of type \"CopySourceOrStrTypeDef\" in function \"copy_from\"\n\u00a0\u00a0Type \"Literal[123]\" is not assignable to type \"CopySourceOrStrTypeDef\"\n\u00a0\u00a0\u00a0\u00a0\"Literal[123]\" is not assignable to \"str\"\n\u00a0\u00a0\u00a0\u00a0\"Literal[123]\" is not assignable to \"CopySourceTypeDef\"", "range": { "start": { - "line": 53, + "line": 52, "character": 47 }, "end": { - "line": 53, + "line": 52, "character": 50 } }, @@ -109,11 +109,11 @@ "message": "Argument of type \"Literal['none']\" cannot be assigned to parameter \"RequestPayer\" of type \"Literal['requester']\" in function \"abort\"\n\u00a0\u00a0\"Literal['none']\" is not assignable to type \"Literal['requester']\"", "range": { "start": { - "line": 57, + "line": 56, "character": 58 }, "end": { - "line": 57, + "line": 56, "character": 64 } }, @@ -124,11 +124,11 @@ "message": "Argument of type \"Literal['1']\" cannot be assigned to parameter \"part_number\" of type \"int\" in function \"Part\"\n\u00a0\u00a0\"Literal['1']\" is not assignable to \"int\"", "range": { "start": { - "line": 58, + "line": 57, "character": 44 }, "end": { - "line": 58, + "line": 57, "character": 47 } }, @@ -139,11 +139,11 @@ "message": "No parameter named \"wrong_arg\"", "range": { "start": { - "line": 59, + "line": 58, "character": 26 }, "end": { - "line": 59, + "line": 58, "character": 35 } }, @@ -154,11 +154,11 @@ "message": "Argument of type \"Literal[b\"asd\"]\" cannot be assigned to parameter \"Fileobj\" of type \"FileobjTypeDef\" in function \"download_fileobj\"\n\u00a0\u00a0Type \"Literal[b\"asd\"]\" is not assignable to type \"FileobjTypeDef\"\n\u00a0\u00a0\u00a0\u00a0\"Literal[b\"asd\"]\" is not assignable to \"IO[Any]\"\n\u00a0\u00a0\u00a0\u00a0\"Literal[b\"asd\"]\" is not assignable to \"StreamingBody\"", "range": { "start": { - "line": 75, + "line": 74, "character": 55 }, "end": { - "line": 75, + "line": 74, "character": 61 } }, @@ -169,11 +169,11 @@ "message": "Argument of type \"None\" cannot be assigned to parameter \"IfModifiedSince\" of type \"TimestampTypeDef\" in function \"get_object\"\n\u00a0\u00a0Type \"None\" is not assignable to type \"TimestampTypeDef\"\n\u00a0\u00a0\u00a0\u00a0\"None\" is not assignable to \"datetime\"\n\u00a0\u00a0\u00a0\u00a0\"None\" is not assignable to \"str\"", "range": { "start": { - "line": 76, + "line": 75, "character": 76 }, "end": { - "line": 76, + "line": 75, "character": 80 } }, @@ -184,11 +184,11 @@ "message": "Argument missing for parameter \"Bucket\"", "range": { "start": { - "line": 79, + "line": 78, "character": 14 }, "end": { - "line": 79, + "line": 78, "character": 56 } }, @@ -199,11 +199,11 @@ "message": "No parameter named \"bucket\"", "range": { "start": { - "line": 79, + "line": 78, "character": 40 }, "end": { - "line": 79, + "line": 78, "character": 46 } }, @@ -214,11 +214,11 @@ "message": "\"__getitem__\" method not defined on type \"Coroutine[Any, Any, CreateBucketOutputTypeDef]\"", "range": { "start": { - "line": 83, + "line": 82, "character": 8 }, "end": { - "line": 83, + "line": 82, "character": 16 } }, @@ -229,11 +229,11 @@ "message": "Argument missing for parameter \"Key\"", "range": { "start": { - "line": 86, + "line": 85, "character": 26 }, "end": { - "line": 86, + "line": 85, "character": 60 } }, @@ -244,11 +244,11 @@ "message": "Argument of type \"dict[str, list[dict[str, tuple[Literal['get']] | list[str]]]]\" cannot be assigned to parameter \"CORSConfiguration\" of type \"CORSConfigurationTypeDef\" in function \"put_bucket_cors\"\n\u00a0\u00a0\"Allowedorigins\" is an undefined item in type \"CORSRuleTypeDef\"", "range": { "start": { - "line": 96, + "line": 95, "character": 59 }, "end": { - "line": 96, + "line": 95, "character": 75 } }, @@ -259,11 +259,11 @@ "message": "Argument of type \"None\" cannot be assigned to parameter \"Key\" of type \"str\" in function \"get_object\"\n\u00a0\u00a0\"None\" is not assignable to \"str\"", "range": { "start": { - "line": 103, + "line": 102, "character": 57 }, "end": { - "line": 103, + "line": 102, "character": 61 } }, @@ -274,11 +274,11 @@ "message": "Cannot access attribute \"operations_name\" for class \"ClientError\"\n\u00a0\u00a0Attribute \"operations_name\" is unknown", "range": { "start": { - "line": 105, + "line": 104, "character": 20 }, "end": { - "line": 105, + "line": 104, "character": 35 } }, @@ -289,11 +289,11 @@ "message": "\"AsyncIterator[bytes]\" is not iterable\n\u00a0\u00a0\"__iter__\" method not defined", "range": { "start": { - "line": 109, + "line": 108, "character": 21 }, "end": { - "line": 109, + "line": 108, "character": 45 } }, diff --git a/integration/types_aioboto3/s3_example.py b/integration/types_aioboto3/s3_example.py index f4766748..bdb1a5f3 100644 --- a/integration/types_aioboto3/s3_example.py +++ b/integration/types_aioboto3/s3_example.py @@ -12,7 +12,6 @@ from typing import TYPE_CHECKING import aioboto3 -from aiobotocore.session import get_session if TYPE_CHECKING: from types_aiobotocore_s3.client import S3Client @@ -64,12 +63,12 @@ async def s3_client_example() -> None: """ Usage example for S3Client. """ - session = get_session() + session = aioboto3.Session() # type annotation is optional here client: S3Client - async with session.create_client("s3", region_name="us-west-1") as client: + async with session.client("s3", region_name="us-west-1") as client: bucket_exists_waiter = client.get_waiter("bucket_exists") # check that injected methods are not kw-only