Skip to content

Commit b9cbb07

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 14d35ad commit b9cbb07

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ def gpu_count_on_cluster(nodes: list[Any]) -> int:
831831
if key in allowed_exact or any(key.startswith(p) for p in allowed_prefixes):
832832
try:
833833
total_gpus += int(val)
834-
except (ValueError, TypeError):
834+
except ValueError, TypeError:
835835
LOGGER.debug(f"Skipping non-integer allocatable for {key} on {node.name}: {val!r}")
836836
continue
837837
return total_gpus

tests/model_registry/model_catalog/search/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def _validate_single_criterion(
404404
else:
405405
LOGGER.warning(f"Unknown key_type: {key_type}")
406406
return False, f"{key_name}: unknown type {key_type}"
407-
except (ValueError, TypeError):
407+
except ValueError, TypeError:
408408
return False, f"{key_name}: conversion error"
409409

410410
# Perform comparison based on type

tests/model_serving/model_server/kserve/inference_graph/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ def dog_breed_inference_graph(
128128

129129
try:
130130
name = request.param["name"]
131-
except (AttributeError, KeyError):
131+
except AttributeError, KeyError:
132132
name = "dog-breed-pipeline"
133133

134134
try:
135135
if not request.param["external-route"]:
136136
labels[networking_label] = "cluster-local"
137-
except (AttributeError, KeyError):
137+
except AttributeError, KeyError:
138138
pass
139139

140140
with InferenceGraph(
@@ -256,7 +256,7 @@ def bare_service_account(
256256
try:
257257
if request.param["name"]:
258258
name = request.param["name"]
259-
except (AttributeError, KeyError):
259+
except AttributeError, KeyError:
260260
name = "sa-" + token_hex(4)
261261

262262
with ServiceAccount(

tests/model_serving/model_server/maas_billing/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def mint_token(
9999
)
100100
try:
101101
body = resp.json()
102-
except (JSONDecodeError, ValueError):
102+
except JSONDecodeError, ValueError:
103103
body = {}
104104
return resp, body
105105

@@ -400,7 +400,7 @@ def get_total_tokens(resp: Response, *, fail_if_missing: bool = False) -> int |
400400
if header_val is not None:
401401
try:
402402
return int(header_val)
403-
except (TypeError, ValueError):
403+
except TypeError, ValueError:
404404
if fail_if_missing:
405405
raise AssertionError(
406406
f"Token usage header is not parseable as int; headers={dict(resp.headers)} body={resp.text[:500]}"

utilities/infra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ def wait_for_serverless_pods_deletion(resource: Project | Namespace, admin_clien
987987
LOGGER.info(f"Waiting for {KServeDeploymentType.SERVERLESS} pod {pod.name} to be deleted")
988988
pod.wait_deleted(timeout=Timeout.TIMEOUT_1MIN)
989989

990-
except (ResourceNotFoundError, NotFoundError):
990+
except ResourceNotFoundError, NotFoundError:
991991
LOGGER.info(f"Pod {pod.name} is deleted")
992992

993993

utilities/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class RedactedString(str):
1414
Used to redact the representation of a sensitive string.
1515
"""
1616

17-
def __new__(cls, *, value: object) -> "RedactedString": # noqa: PYI034
17+
def __new__(cls, *, value: object) -> RedactedString: # noqa: PYI034
1818
return super().__new__(cls, value)
1919

2020
def __repr__(self) -> str:

utilities/plugins/openai_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def streaming_request_http(
104104
message = json.loads(data)
105105
token = self._parse_streaming_response(endpoint, message)
106106
tokens.append(token)
107-
except (requests.exceptions.RequestException, json.JSONDecodeError):
107+
except requests.exceptions.RequestException, json.JSONDecodeError:
108108
LOGGER.error("Streaming request error")
109109
raise
110110
return "".join(tokens)
@@ -137,7 +137,7 @@ def get_request_http(host: str, endpoint: str) -> Any:
137137
if data:
138138
data = OpenAIClient._remove_keys(data, keys_to_remove)
139139
return data # noqa: TRY300
140-
except (requests.exceptions.RequestException, json.JSONDecodeError):
140+
except requests.exceptions.RequestException, json.JSONDecodeError:
141141
LOGGER.exception("Request error")
142142

143143
@retry(stop=stop_after_attempt(MAX_RETRIES), wait=wait_exponential(min=1, max=6))

0 commit comments

Comments
 (0)