Skip to content

Commit 4a2589a

Browse files
committed
fix: Use starred tuple unpacking on GCS artifact blob names for versions function
1 parent c25911c commit 4a2589a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/google/adk/artifacts/gcs_artifact_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,6 @@ async def list_versions(
213213
blobs = self.storage_client.list_blobs(self.bucket, prefix=prefix)
214214
versions = []
215215
for blob in blobs:
216-
_, _, _, _, version = blob.name.split("/")
216+
*_, version = blob.name.split("/")
217217
versions.append(int(version))
218218
return versions

tests/unittests/artifacts/test_artifact_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ async def test_list_versions(service_type):
253253
app_name = "app0"
254254
user_id = "user0"
255255
session_id = "123"
256-
filename = "filename"
256+
filename = "with/slash/filename"
257257
versions = [
258258
types.Part.from_bytes(
259259
data=i.to_bytes(2, byteorder="big"), mime_type="text/plain"

0 commit comments

Comments
 (0)