From 48b72684bbffdf1b264895f57502f4920288dfd1 Mon Sep 17 00:00:00 2001 From: jameshod5 Date: Fri, 24 May 2024 13:45:48 +0100 Subject: [PATCH] ruff fixes --- src/api/graphql.py | 4 ++-- src/api/main.py | 2 +- src/api/models.py | 3 +-- src/api/page.py | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/api/graphql.py b/src/api/graphql.py index 773c86c..c82cf9b 100644 --- a/src/api/graphql.py +++ b/src/api/graphql.py @@ -264,7 +264,7 @@ def signal_datasets( self, limit: Optional[int] = None, where: Optional[ShotWhereFilter] = None, - ) -> List[strawberry.LazyType["Shot", __module__]]: + ) -> List[strawberry.LazyType["Shot", __module__]]: # noqa: F821 results = do_where_child_member(self.signal_datasets, where) if limit is not None: results = results[:limit] @@ -273,7 +273,7 @@ def signal_datasets( @strawberry.field def signals( self, limit: Optional[int] = None, where: Optional[SignalWhereFilter] = None - ) -> List[strawberry.LazyType["Signal", __module__]]: + ) -> List[strawberry.LazyType["Signal", __module__]]: # noqa: F821 results = do_where_child_member(self.signals, where) if limit is not None: results = results[:limit] diff --git a/src/api/main.py b/src/api/main.py index 4681685..a1ba986 100644 --- a/src/api/main.py +++ b/src/api/main.py @@ -382,7 +382,7 @@ def get_sources( "/json/sources/{name}", description="Get information about a single signal", ) -def get_signal(db: Session = Depends(get_db), name: str = None) -> models.SourceModel: +def get_single_source(db: Session = Depends(get_db), name: str = None) -> models.SourceModel: source = crud.get_source(db, name) source = db.execute(source).one()[0] return source diff --git a/src/api/models.py b/src/api/models.py index 12a0065..f27d223 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -6,8 +6,7 @@ Text, Enum, ) -from sqlalchemy.dialects.postgresql import UUID, JSONB -from sqlalchemy.orm import relationship +from sqlalchemy.dialects.postgresql import JSONB import datetime import uuid as uuid_pkg diff --git a/src/api/page.py b/src/api/page.py index c36a587..3f266ef 100644 --- a/src/api/page.py +++ b/src/api/page.py @@ -3,7 +3,6 @@ __all__ = [ "Params", "OptionalParams", - "Page", ] from math import ceil