Skip to content

Incorrect location for versioning registry when created from the fully qualified model name #2608

@racinmat

Description

@racinmat

The model versioning registry does not use the location from fully-qualified model name. It should be using the same location as the model when it gets the fully qualified resource name.

Environment details

  • OS type and version: windows 10
  • Python version: Python 3.11.5
  • pip version: pip 23.2.1 from C:\Users\E10270\.conda\envs\py311test\Lib\site-packages\pip (python 3.11)
  • google-cloud-aiplatform version:
Name: google-cloud-aiplatform
Version: 1.33.1
Summary: Vertex AI API client library
Home-page: https://github.com/googleapis/python-aiplatform
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: C:\Users\E10270\.conda\envs\py311test\Lib\site-packages
Requires: google-api-core, google-cloud-bigquery, google-cloud-resource-manager, google-cloud-storage, packaging, proto-plus, protobuf, shapely
Required-by:

Steps to reproduce

  1. Install the package
  2. Run the code
  3. see that the client url for versioning registry

Code example

>>> from google.cloud.aiplatform import Model
>>> versioned_resource_name = 'projects/899305778619/locations/us-east1/models/scam-nlp-genie-scam-detector-type-gpu-2-new-async-model@3'
>>> model = Model(versioned_resource_name)
>>> model.versioning_registry.client.api_endpoint
'us-central1-aiplatform.googleapis.com'
>>> model2 = Model(versioned_resource_name, location='us-east1')
>>> model2.versioning_registry.client.api_endpoint
'us-east1-aiplatform.googleapis.com'

Stack trace

There is none, but it crashes when I try to update the labels using the versioning registry, because it queries incorrect region.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: vertex-aiIssues related to the googleapis/python-aiplatform API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions