Skip to content

Commit 3b37c9f

Browse files
committed
Fix table creation
1 parent 3f25d67 commit 3b37c9f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

fastapi_users_db_dynamodb/_aioboto3_patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import aiobotocore.endpoint
55
import aiobotocore.retryhandler
6-
from aiobotocore.endpoint import HttpxStreamingBody, StreamingBody
7-
from aiobotocore.retryhandler import ChecksumError, logger
6+
from aiobotocore.endpoint import HttpxStreamingBody, StreamingBody # type: ignore
7+
from aiobotocore.retryhandler import ChecksumError, logger # type: ignore
88

99
try:
1010
import httpx
@@ -83,5 +83,5 @@ async def convert_to_response_dict(http_response, operation_model):
8383
return response_dict
8484

8585

86-
aiobotocore.retryhandler.AioCRC32Checker._check_response = _fixed_check_response
86+
aiobotocore.retryhandler.AioCRC32Checker._check_response = _fixed_check_response # type: ignore
8787
aiobotocore.endpoint.convert_to_response_dict = convert_to_response_dict

tests/tables.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import aioboto3
2+
import botocore.exceptions
23

34

45
async def ensure_table_exists(session: aioboto3.Session, table_name: str, region: str):
5-
async with session.resource("dynamodb", region_name=region) as client:
6+
async with session.client("dynamodb", region_name=region) as client:
67
try:
78
await client.describe_table(TableName=table_name)
8-
except client.exceptions.ResourceNotFoundException:
9+
except botocore.exceptions.ClientError:
910
await client.create_table(
1011
TableName=table_name,
1112
KeySchema=[

0 commit comments

Comments
 (0)