feat: support file_data URI references in GcsArtifactService#5322
Open
blueeye-040 wants to merge 1 commit intogoogle:mainfrom
Open
feat: support file_data URI references in GcsArtifactService#5322blueeye-040 wants to merge 1 commit intogoogle:mainfrom
blueeye-040 wants to merge 1 commit intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Collaborator
|
Response from ADK Triaging Agent Hello @blueeye-040, thank you for your contribution! Before we can review your pull request, you'll need to sign the Contributor License Agreement (CLA). You can do this at https://cla.developers.google.com/. Once you've signed the CLA, the status of the check will be updated. Thanks! |
Author
|
I have read the CLA Document and I hereby sign the CLA |
68d876d to
fb49ae6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GcsArtifactServicepreviously raisedNotImplementedErrorwhen saving atypes.Partwithfile_data. This PR adds fullfile_dataURI support to match the existingInMemoryArtifactServicebehavior.Link to Issue or Description of Change
Problem:
GcsArtifactService._save_artifactraisedNotImplementedErrorforfile_dataparts, whileInMemoryArtifactServicealready handled them. This madeGcsArtifactServiceunusable for any workflow that passes file URI references (e.g.gs://orartifact://URIs) as artifacts.Solution:
Store
file_dataURI references as zero-byte GCS blobs with afile_uricustom metadata key — no content to upload, just the URI pointer. On load, check for that metadata key before downloading bytes and restore the originaltypes.Part(file_data=...). Also switched_load_artifactto usebucket.get_blob()(which populates metadata) instead ofbucket.blob()(which does not).artifact://URIs are validated viaartifact_util.parse_artifact_uribefore saving.Testing Plan
Unit Tests:
Added 4 new tests in
tests/unittests/artifacts/test_artifact_service.py:test_gcs_save_artifact_with_external_gcs_uri— roundtrip save/load with ags://URItest_gcs_save_artifact_with_artifact_ref_uri— roundtrip save/load with anartifact://URItest_gcs_save_artifact_file_data_without_mime_type—file_datawith no mime_typetest_gcs_save_artifact_file_data_missing_uri_raises— emptyfile_uriraisesInputValidationError