Skip to content

Conversation

@samgoodman
Copy link
Contributor

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:

  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels May 17, 2022
@samgoodman samgoodman force-pushed the goodmansam/usecompats branch from 70c0118 to e48d752 Compare May 17, 2022 04:17
Copy link
Contributor

@sararob sararob left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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)

@samgoodman samgoodman merged commit a2eb8cc into main May 18, 2022
@samgoodman samgoodman deleted the goodmansam/usecompats branch May 18, 2022 16:19
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: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants