Skip to content

Commit

Permalink
fix types for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed May 30, 2024
1 parent e4405f1 commit 90942e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions store/app/api/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import aioboto3
from types_aiobotocore_dynamodb.service_resource import DynamoDBServiceResource
import itertools


class BaseCrud(AsyncContextManager["BaseCrud"]):
Expand Down Expand Up @@ -39,8 +40,10 @@ async def _create_dynamodb_table(
deletion_protection: bool = False,
) -> None:
table = await self.db.create_table(
AttributeDefinitions=[{"AttributeName": n, "AttributeType": t} for n, t, _ in keys]
+ [{"AttributeName": n, "AttributeType": t} for _, n, t, _ in gsis],
AttributeDefinitions=[
{"AttributeName": n, "AttributeType": t}
for n, t in itertools.chain(((n, t) for (n, t, _) in keys), ((n, t) for _, n, t, _ in gsis))
],
TableName=name,
KeySchema=[{"AttributeName": n, "KeyType": t} for n, _, t in keys],
GlobalSecondaryIndexes=[
Expand Down

0 comments on commit 90942e1

Please sign in to comment.