mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
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:
committed by
Copybara-Service
parent
7c670f638b
commit
3b1d9a8a3e
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""An artifact service implementation using Google Cloud Storage (GCS)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Optional
|
||||
@@ -151,7 +152,7 @@ class GcsArtifactService(BaseArtifactService):
|
||||
self.bucket, prefix=session_prefix
|
||||
)
|
||||
for blob in session_blobs:
|
||||
_, _, _, filename, _ = blob.name.split("/")
|
||||
*_, filename, _ = blob.name.split("/")
|
||||
filenames.add(filename)
|
||||
|
||||
user_namespace_prefix = f"{app_name}/{user_id}/user/"
|
||||
@@ -159,7 +160,7 @@ class GcsArtifactService(BaseArtifactService):
|
||||
self.bucket, prefix=user_namespace_prefix
|
||||
)
|
||||
for blob in user_namespace_blobs:
|
||||
_, _, _, filename, _ = blob.name.split("/")
|
||||
*_, filename, _ = blob.name.split("/")
|
||||
filenames.add(filename)
|
||||
|
||||
return sorted(list(filenames))
|
||||
|
||||
Reference in New Issue
Block a user