Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Mar 7, 2024
1 parent 3fa0c6f commit ea334c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/blueapi/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
from pydantic import ValidationError, parse_obj_as
import logging
from collections import deque
from functools import wraps
Expand All @@ -8,6 +7,7 @@
from typing import Optional, Tuple, Union

import click
from pydantic import ValidationError, parse_obj_as
from requests.exceptions import ConnectionError

from blueapi import __version__
Expand Down Expand Up @@ -191,10 +191,11 @@ def store_finished_event(event: WorkerEvent) -> None:
print(text)
validated_data = parse_obj_as(type(schema), parameters)
print("Plan params validation successful:", validated_data)
except ValidationError as e:
except ValidationError:
# Handle the case where the parameters are invalid according to the PlanModel
print(
f"failed to run the {name} plan, supplied params {parameters} do not match the expected params: {schema}"
f"""failed to run the {name} plan,
supplied params {parameters} do not match the expected params: {schema}"""
)
return

Expand Down
7 changes: 4 additions & 3 deletions src/blueapi/cli/rest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Any, Callable, Literal, Mapping, Optional, Type, TypeVar

from http import HTTPStatus
from typing import Any, Callable, Literal, Mapping, Optional, Type, TypeVar

import requests
from pydantic import parse_obj_as
Expand Down Expand Up @@ -119,7 +118,9 @@ def _request_and_deserialize(
if raise_if(response):
message = get_status_message(response.status_code)
t = response.text
error_message = f"Response failed with text: {t}, with error code: {response.status_code} which corresponds to {message}"
error_message = f"""Response failed with text: {t},
with error code: {response.status_code}
which corresponds to {message}"""
raise BlueskyRemoteError(error_message)
deserialized = parse_obj_as(target_type, response.json())
return deserialized
Expand Down

0 comments on commit ea334c8

Please sign in to comment.