fix: Use starred tuple unpacking on GCS artifact blob names

Merges https://github.com/google/adk-python/pull/1471

Fixes google#1436

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/1471 from bck-ob-gh:main 4c4f2b66ab1e6fde8b1a9d2b914dcb24040db144
PiperOrigin-RevId: 774809270
This commit is contained in:
bck-ob-gh
2025-06-23 09:24:31 -07:00
committed by Copybara-Service
parent 7c670f638b
commit 3b1d9a8a3e
@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
"""An artifact service implementation using Google Cloud Storage (GCS).""" """An artifact service implementation using Google Cloud Storage (GCS)."""
from __future__ import annotations
import logging import logging
from typing import Optional from typing import Optional
@@ -151,7 +152,7 @@ class GcsArtifactService(BaseArtifactService):
self.bucket, prefix=session_prefix self.bucket, prefix=session_prefix
) )
for blob in session_blobs: for blob in session_blobs:
_, _, _, filename, _ = blob.name.split("/") *_, filename, _ = blob.name.split("/")
filenames.add(filename) filenames.add(filename)
user_namespace_prefix = f"{app_name}/{user_id}/user/" user_namespace_prefix = f"{app_name}/{user_id}/user/"
@@ -159,7 +160,7 @@ class GcsArtifactService(BaseArtifactService):
self.bucket, prefix=user_namespace_prefix self.bucket, prefix=user_namespace_prefix
) )
for blob in user_namespace_blobs: for blob in user_namespace_blobs:
_, _, _, filename, _ = blob.name.split("/") *_, filename, _ = blob.name.split("/")
filenames.add(filename) filenames.add(filename)
return sorted(list(filenames)) return sorted(list(filenames))