From 9815f062af89e75006e9e12da68a7bad885512f2 Mon Sep 17 00:00:00 2001 From: Hans Trompert Date: Tue, 26 Mar 2024 14:14:29 +0100 Subject: [PATCH] fix various linting errors --- src/supa/connection/provider/server.py | 8 ++++---- src/supa/job/reserve.py | 2 +- src/supa/job/shared.py | 2 +- src/supa/nrm/backends/surf.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/supa/connection/provider/server.py b/src/supa/connection/provider/server.py index 019ab10c..9086af9c 100644 --- a/src/supa/connection/provider/server.py +++ b/src/supa/connection/provider/server.py @@ -163,7 +163,7 @@ def _register_request( is stored in this function. """ if not connection_id and type(request) != QueryRequest: - connection_id = UUID(request.connection_id) # type: ignore[arg-type] + connection_id = UUID(request.connection_id) from supa.db.session import db_session @@ -243,9 +243,9 @@ def Reserve(self, pb_reserve_request: ReserveRequest, context: ServicerContext) requester_nsa=pb_header.requester_nsa, provider_nsa=pb_header.provider_nsa, reply_to=pb_header.reply_to if pb_header.reply_to else None, - session_security_attributes=pb_header.session_security_attributes - if pb_header.session_security_attributes - else None, + session_security_attributes=( + pb_header.session_security_attributes if pb_header.session_security_attributes else None + ), global_reservation_id=pb_reserve_request.global_reservation_id, description=pb_reserve_request.description if pb_reserve_request.description else None, version=pb_criteria.version, diff --git a/src/supa/job/reserve.py b/src/supa/job/reserve.py index cbf16240..575484fb 100644 --- a/src/supa/job/reserve.py +++ b/src/supa/job/reserve.py @@ -671,7 +671,7 @@ def __call__(self) -> None: self.log.debug("Sending message", method="ReserveTimeout", request_message=request) stub.ReserveTimeout(request) else: - register_result(request, ResultType.Error) # type: ignore[arg-type] + register_result(request, ResultType.Error) self.log.debug("Sending message", method="Error", request_message=request) stub.Error(request) diff --git a/src/supa/job/shared.py b/src/supa/job/shared.py index a99096f2..efa20c31 100644 --- a/src/supa/job/shared.py +++ b/src/supa/job/shared.py @@ -223,7 +223,7 @@ def register_result( if type(request) == ErrorRequest: connection_id = request.service_exception.connection_id else: - connection_id = request.connection_id # type: ignore[union-attr] + connection_id = request.connection_id with db_session() as session: try: # find the highest result ID for this connection ID and increment by 1 diff --git a/src/supa/nrm/backends/surf.py b/src/supa/nrm/backends/surf.py index ba99f51a..3e3eb4cc 100644 --- a/src/supa/nrm/backends/surf.py +++ b/src/supa/nrm/backends/surf.py @@ -18,7 +18,7 @@ from pydantic import BaseSettings from requests import get, post from requests.auth import HTTPBasicAuth -from requests.exceptions import ConnectionError, HTTPError +from requests.exceptions import ConnectionError, HTTPError # noqa: A004 from structlog.stdlib import BoundLogger from supa.connection.error import GenericRmError