From cbe5c56270609cb4fb7c42c19da520a1cdfbf9d3 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 15 May 2024 20:41:48 +0000 Subject: [PATCH] chore(jobs): shorter typehints and import sorting --- selfprivacy_api/graphql/queries/jobs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/selfprivacy_api/graphql/queries/jobs.py b/selfprivacy_api/graphql/queries/jobs.py index 337382a..3cc3bf7 100644 --- a/selfprivacy_api/graphql/queries/jobs.py +++ b/selfprivacy_api/graphql/queries/jobs.py @@ -1,17 +1,17 @@ """Jobs status""" # pylint: disable=too-few-public-methods -import typing import strawberry +from typing import List, Optional + +from selfprivacy_api.jobs import Jobs from selfprivacy_api.graphql.common_types.jobs import ( ApiJob, get_api_job_by_id, job_to_api_job, ) -from selfprivacy_api.jobs import Jobs - -def get_all_jobs() -> typing.List[ApiJob]: +def get_all_jobs() -> List[ApiJob]: Jobs.get_jobs() return [job_to_api_job(job) for job in Jobs.get_jobs()] @@ -20,9 +20,9 @@ def get_all_jobs() -> typing.List[ApiJob]: @strawberry.type class Job: @strawberry.field - def get_jobs(self) -> typing.List[ApiJob]: + def get_jobs(self) -> List[ApiJob]: return get_all_jobs() @strawberry.field - def get_job(self, job_id: str) -> typing.Optional[ApiJob]: + def get_job(self, job_id: str) -> Optional[ApiJob]: return get_api_job_by_id(job_id)