Skip to content

Commit d3b8145

Browse files
committed
Add type annotations
1 parent e692938 commit d3b8145

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

python/src/etos_api/library/opentelemetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from pydantic import BaseModel
4040

4141

42-
def setup_opentelemetry(app, version: str):
42+
def setup_opentelemetry(app, version: str) -> Resource:
4343
"""Set up OpenTelemetry for ETOS API."""
4444
otel_resource = Resource.create(
4545
{

python/src/etos_api/routers/v0/router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
async def start_etos(
5656
etos: StartEtosRequest,
5757
ctx: Annotated[otel_context.Context, Depends(context)],
58-
):
58+
) -> dict:
5959
"""Start ETOS execution on post.
6060
6161
:param etos: ETOS pydantic model.
@@ -70,7 +70,7 @@ async def start_etos(
7070

7171

7272
@ETOSV0.delete("/etos/{suite_id}", tags=["etos"], response_model=AbortEtosResponse)
73-
async def abort_etos(suite_id: str, ctx: Annotated[otel_context.Context, Depends(context)]):
73+
async def abort_etos(suite_id: str, ctx: Annotated[otel_context.Context, Depends(context)]) -> dict:
7474
"""Abort ETOS execution on delete.
7575
7676
:param suite_id: ETOS suite id

python/src/etos_api/routers/v1alpha/router.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
@ETOSV1ALPHA.post("/testrun", tags=["etos"], response_model=StartTestrunResponse)
6161
async def start_testrun(
6262
etos: StartTestrunRequest, ctx: Annotated[otel_context.Context, Depends(context)]
63-
):
63+
) -> dict:
6464
"""Start ETOS testrun on post.
6565
6666
:param etos: ETOS pydantic model.
@@ -75,7 +75,9 @@ async def start_testrun(
7575

7676

7777
@ETOSV1ALPHA.delete("/testrun/{suite_id}", tags=["etos"], response_model=AbortTestrunResponse)
78-
async def abort_testrun(suite_id: str, ctx: Annotated[otel_context.Context, Depends(context)]):
78+
async def abort_testrun(
79+
suite_id: str, ctx: Annotated[otel_context.Context, Depends(context)]
80+
) -> dict:
7981
"""Abort ETOS testrun on delete.
8082
8183
:param suite_id: ETOS suite id

0 commit comments

Comments
 (0)