Skip to content

Commit da16a6b

Browse files
committed
fix: add type annotations to InputValidationError
1 parent d17c004 commit da16a6b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/google/adk/artifacts/gcs_artifact_service.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,10 @@ def _save_artifact(
232232
)
233233
elif artifact.file_data:
234234
if not artifact.file_data.file_uri:
235-
raise InputValidationError( # type: ignore[no-untyped-call]
236-
"Artifact file_data must have a file_uri."
237-
)
235+
raise InputValidationError("Artifact file_data must have a file_uri.")
238236
if artifact_util.is_artifact_ref(artifact):
239237
if not artifact_util.parse_artifact_uri(artifact.file_data.file_uri):
240-
raise InputValidationError( # type: ignore[no-untyped-call]
238+
raise InputValidationError(
241239
f"Invalid artifact reference URI: {artifact.file_data.file_uri}"
242240
)
243241
# Store the URI as blob metadata; no content to upload.

src/google/adk/errors/input_validation_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class InputValidationError(ValueError):
1919
"""Represents an error raised when user input fails validation."""
2020

21-
def __init__(self, message="Invalid input."):
21+
def __init__(self, message: str = "Invalid input.") -> None:
2222
"""Initializes the InputValidationError exception.
2323
2424
Args:

0 commit comments

Comments
 (0)