Skip to content

Commit d6f4e1a

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

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
@@ -191,6 +191,6 @@ async def list_versions(
191191
blobs = self.storage_client.list_blobs(self.bucket, prefix=prefix)
192192
versions = []
193193
for blob in blobs:
194-
_, _, _, _, version = blob.name.split("/")
194+
*_, version = blob.name.split("/")
195195
versions.append(int(version))
196196
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)