Repository navigation
fix: keep the caller's project, location and credentials when metadata schemas reload - #7259
Open
abhishekacharya200 wants to merge 1 commit into
Conversation
…a schemas reload create and start_execution passed these to the service, then reloaded the new resource without them, so the reload fell back to the values from aiplatform.init.
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.
Fixes #7258
The metadata schema classes create a resource with the caller's
project,locationandcredentials, then reload it through_init_with_resource_namewithout them, so the reload used the values fromaiplatform.init. This affectsBaseArtifactSchema.create,BaseExecutionSchema.create,BaseExecutionSchema.start_executionandBaseContextSchema.create.Each reload now gets the same values.
_init_with_resource_nameon the execution and context classes takes the same optional arguments the artifact class already has.start_executiondoesn't passmetadata_store_id, since it only supports the default store. Callers who don't set these see no change.Added four tests in
TestMetadataSchemaReloadUsesCallerSettings, which fail onmainand pass with this change. They check the arguments of the reload call with the create and reload mocked; I haven't run this against a real project.test_metadata_schema.py(78),test_metadata_resources.py(30) andtest_metadata_store.py(7) pass locally, and black 24.8.0 and flake8 6.1.0 report nothing on the changed files.