Skip to content

fix: Starred tuple unpacking everywhere in GCS artifact service #1669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zshehov
Copy link

@zshehov zshehov commented Jun 26, 2025

Follow up for 3b1d9a8 -- the starred unpacking was forgotten for the list_versions method.

Issue Description
When using GCS artifact service, including a slash in a blob's name results in a crash during the list_versions method.

The exact crash happens on line 194 of adk.artifacts.gcs_artifact_service, in the list_versions method while iterating over blobs. The exception is raised because the blob name is split by the forward slash character, and the resulting list is unpacked with the expectation that it has exactly five elements.

Because of the semantics of the path building, it is certain that the last word is the version, regardless of the words before it. Using the starred iterable unpacking in the list_versions method makes it consistent with the other unpacking sites and addresses the method's intent more concretely anyway.

A nice side-effect is that it permits hierarchical naming 🪄

Testing Plan
I ran the test suite with pytest ./tests/unittests, the summary results are: 2639 passed, 2 failed - but the failed seem irrelevant:

test_execute_sql_declaration_write[GOOGLE_AI-explicit-all-write]
test_execute_sql_declaration_write[VERTEX-explicit-all-write]

They also fail on main.

Changed the filename in list_versions test to include slashes and the test passes.

In addition, I performed manual testing by running adk web locally against a GCS artifacts service and verified that no exceptions are raised when asking the agent to create and load artifacts.

Fixes: #1314

@zshehov zshehov force-pushed the use-starred-tuple-unpacking-on-gcs-artifact-blob-names-versions branch from effa0c5 to b7771e9 Compare June 26, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too strict assumption when listing GCS artifact service versions
1 participant