-
Notifications
You must be signed in to change notification settings - Fork 426
chore: Remove _v1 specific references in favor of compat types and services #1235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
70c0118 to
e48d752
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, otherwise this looks good. Also, I don't think you need to update any system tests for this but wanted to confirm.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question as above re: duplication of types.index_v1 and types.index_endpoint_v1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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: