chore: Remove _v1 specific references in favor of compat types and services#1235
Conversation
70c0118 to
e48d752
Compare
| types.featurestore_service = types.featurestore_service_v1beta1 | ||
| types.hyperparameter_tuning_job = types.hyperparameter_tuning_job_v1beta1 | ||
| types.index = types.index_v1beta1 | ||
| types.index_endpoint = types.index_endpoint_v1beta1 |
There was a problem hiding this comment.
What's the difference between types.index_endpoint and types.matching_engine_index_endpoint below? It looks like they both point to types.index_endpoint_v1beta1.
There was a problem hiding this comment.
Great question! Someone previously attempted to perform the following compat type renames:
index->matching_engine_index
index_endpoint->matching_engine_index_endpoint
The problem here is that the underlying types for those compat types are still index (index_v1, index_v1beta1) and index_endpoint (index_endpoint_v1, index_endpoint_v1beta1). This introduces ambiguity and strays from the naming conventions of the underlying GAPIC types (and makes me pull out my hair for 30 minutes wondering if I'm losing my mind).
This change re-introduces index and index_endpoint as compat types, while preserving the matching_engine_index and matching_engine_index_endpoint types (which map to index and index_endpoint) for backwards compatibility.
There was a problem hiding this comment.
In a nutshell:
This:
from google.cloud.aiplatform_v1.types import index
Should be equivalent to this:
from google.cloud.aiplatform.compat.types import index
But it isn't because 'index' doesn't exist as a compat type because of the rename above.
You need to use this:
from google.cloud.aiplatform.compat.types import matching_engine_index
With this change, the following are equivalent
from google.cloud.aiplatform_v1.types import index
from google.cloud.aiplatform.compat.types import index
from google.cloud.aiplatform.compat.types import matching_engine_index
There was a problem hiding this comment.
Thanks for the context! That makes sense.
| types.featurestore_service = types.featurestore_service_v1 | ||
| types.hyperparameter_tuning_job = types.hyperparameter_tuning_job_v1 | ||
| types.index = types.index_v1 | ||
| types.index_endpoint = types.index_endpoint_v1 |
There was a problem hiding this comment.
Similar question as above re: duplication of types.index_v1 and types.index_endpoint_v1.
There was a problem hiding this comment.
(conversation included in the above comment)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: