Skip to content

fix: keep the caller's project, location and credentials when metadata schemas reload - #7259

Open
abhishekacharya200 wants to merge 1 commit into
googleapis:mainfrom
abhishekacharya200:fix/metadata-schema-reload-credentials
Open

abhishekacharya200 wants to merge 1 commit into
googleapis:mainfrom
abhishekacharya200:fix/metadata-schema-reload-credentials

Conversation

@abhishekacharya200

@abhishekacharya200 abhishekacharya200 commented Oct 31, 2026 •

Copy link
Copy Markdown

Fixes #7258

The metadata schema classes create a resource with the caller's project, location and credentials, then reload it through _init_with_resource_name without them, so the reload used the values from aiplatform.init. This affects BaseArtifactSchema.create, BaseExecutionSchema.create, BaseExecutionSchema.start_execution and BaseContextSchema.create.

Each reload now gets the same values. _init_with_resource_name on the execution and context classes takes the same optional arguments the artifact class already has. start_execution doesn't pass metadata_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 on main and 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) and test_metadata_store.py (7) pass locally, and black 24.8.0 and flake8 6.1.0 report nothing on the changed files.

…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.
@abhishekacharya200
abhishekacharya200 requested a review from a team as a code owner October 31, 2026 13:45
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metadata schema create drops project, location and credentials when it reloads the resource

1 participant