Skip to content

Commit 25cd06b

Browse files
bck-ob-ghcopybara-github
authored andcommitted
fix: Use starred tuple unpacking on GCS artifact blob names
Merges google#1471 Fixes google#1436 COPYBARA_INTEGRATE_REVIEW=google#1471 from bck-ob-gh:main 4c4f2b6 PiperOrigin-RevId: 774809270
1 parent d154028 commit 25cd06b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/google/adk/artifacts/gcs_artifact_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""An artifact service implementation using Google Cloud Storage (GCS)."""
16+
from __future__ import annotations
1617

1718
import logging
1819
from typing import Optional
@@ -151,15 +152,15 @@ async def list_artifact_keys(
151152
self.bucket, prefix=session_prefix
152153
)
153154
for blob in session_blobs:
154-
_, _, _, filename, _ = blob.name.split("/")
155+
*_, filename, _ = blob.name.split("/")
155156
filenames.add(filename)
156157

157158
user_namespace_prefix = f"{app_name}/{user_id}/user/"
158159
user_namespace_blobs = self.storage_client.list_blobs(
159160
self.bucket, prefix=user_namespace_prefix
160161
)
161162
for blob in user_namespace_blobs:
162-
_, _, _, filename, _ = blob.name.split("/")
163+
*_, filename, _ = blob.name.split("/")
163164
filenames.add(filename)
164165

165166
return sorted(list(filenames))

0 commit comments

Comments
 (0)