Skip to content

Commit

Permalink
Slap in some type ignores
Browse files Browse the repository at this point in the history
Can't easily work out db response types, but pydantic will take care of
us
  • Loading branch information
wjdp committed Jul 28, 2023
1 parent d6d3bf0 commit a3b4728
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lumina/database/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ def get_submission(id: int) -> SubmissionModel:
raise ResultNotFound(f"Submission with id {id} not found")
if response["Count"] > 1:
raise DbError(f"Multiple submissions with id {id} found")
return SubmissionModel(**response["Items"][0])
return SubmissionModel(**response["Items"][0]) # type: ignore


def get_submissions_for_member(id: str | UUID) -> list[SubmissionModel]:
response = get_member_table().query(
KeyConditionExpression=Key(MEMBER_PARTITION_KEY).eq(str(id))
& Key(MEMBER_SORT_KEY).begins_with(SK_SUBMISSION_PREFIX),
)
return [SubmissionModel(**item) for item in response["Items"]]
return [SubmissionModel(**item) for item in response["Items"]] # type: ignore


def get_submissions_for_target(
Expand All @@ -92,7 +92,7 @@ def get_submissions_for_target(
KeyConditionExpression=Key(GSI_SUBMISSION_TARGET_PK).eq(target_type)
& Key(GSI_SUBMISSION_TARGET_SK).eq(target_id),
)
return [SubmissionModel(**item) for item in response["Items"]]
return [SubmissionModel(**item) for item in response["Items"]] # type: ignore


def put_submission(model: SubmissionModel) -> SubmissionModel:
Expand Down

0 comments on commit a3b4728

Please sign in to comment.