Skip to content

Commit f99fc03

Browse files
committed
Add type annotation for mypy
1 parent 040843d commit f99fc03

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

jbi/router.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import secrets
66
from pathlib import Path
7-
from typing import Annotated, Optional
7+
from typing import Annotated, Any, Optional
88

99
from fastapi import APIRouter, Body, Depends, HTTPException, Request, status
1010
from fastapi.encoders import jsonable_encoder
@@ -83,21 +83,18 @@ async def inspect_dl_queue(queue: Annotated[DeadLetterQueue, Depends(get_dl_queu
8383
"""API for viewing queue content"""
8484
bugs = await queue.retrieve()
8585
results = []
86+
fields: dict[str, Any] = {
87+
"identifier": True,
88+
"rid": True,
89+
"error": True,
90+
"payload": {
91+
"bug": {"id", "whiteboard", "product", "component"},
92+
"event": {"action", "time"},
93+
},
94+
}
8695
for items in bugs.values():
8796
async for item in items:
88-
results.append(
89-
item.model_dump(
90-
include={ # type: ignore
91-
"identifier": True,
92-
"rid": True,
93-
"error": True,
94-
"payload": {
95-
"bug": {"id", "whiteboard", "product", "component"},
96-
"event": {"action", "time"},
97-
},
98-
}
99-
)
100-
)
97+
results.append(item.model_dump(include=fields))
10198
return results
10299

103100

0 commit comments

Comments
 (0)