Skip to content

Commit cd9cd6b

Browse files
committed
style: apply pyink formatting and add return type annotation
1 parent fa1c93f commit cd9cd6b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/google/adk/artifacts/file_artifact_service.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ def _validate_path_segment(value: str, name: str) -> None:
7676
if not value:
7777
raise InputValidationError(f"{name} must not be empty.")
7878
if any(sep in value for sep in ("/", "\\", "..")):
79-
raise InputValidationError(
80-
f"{name} contains invalid characters: {value!r}"
81-
)
79+
raise InputValidationError(f"{name} contains invalid characters: {value!r}")
8280

8381

8482
_USER_NAMESPACE_PREFIX = "user:"

tests/unittests/artifacts/test_artifact_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ async def test_file_save_artifact_rejects_absolute_path_within_scope(tmp_path):
783783
)
784784
async def test_file_save_artifact_rejects_path_traversal_in_ids(
785785
tmp_path, user_id, session_id
786-
):
786+
) -> None:
787787
"""FileArtifactService rejects user_id/session_id with path traversal."""
788788
artifact_service = FileArtifactService(root_dir=tmp_path / "artifacts")
789789
part = types.Part(text="content")

0 commit comments

Comments
 (0)