diff --git a/docs/aiplatform_v1/services_.rst b/docs/aiplatform_v1/services_.rst new file mode 100644 index 0000000000..93afd80841 --- /dev/null +++ b/docs/aiplatform_v1/services_.rst @@ -0,0 +1,23 @@ +Services for Google Cloud Aiplatform v1 API +=========================================== +.. toctree:: + :maxdepth: 2 + + dataset_service + endpoint_service + featurestore_online_serving_service + featurestore_service + index_endpoint_service + index_service + job_service + match_service + metadata_service + migration_service + model_garden_service + model_service + pipeline_service + prediction_service + schedule_service + specialist_pool_service + tensorboard_service + vizier_service diff --git a/docs/aiplatform_v1/types_.rst b/docs/aiplatform_v1/types_.rst new file mode 100644 index 0000000000..da19f0e39e --- /dev/null +++ b/docs/aiplatform_v1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform v1 API +======================================== + +.. automodule:: google.cloud.aiplatform_v1.types + :members: + :show-inheritance: diff --git a/docs/aiplatform_v1beta1/services_.rst b/docs/aiplatform_v1beta1/services_.rst new file mode 100644 index 0000000000..809b60c29c --- /dev/null +++ b/docs/aiplatform_v1beta1/services_.rst @@ -0,0 +1,28 @@ +Services for Google Cloud Aiplatform v1beta1 API +================================================ +.. toctree:: + :maxdepth: 2 + + dataset_service + deployment_resource_pool_service + endpoint_service + feature_online_store_admin_service + feature_online_store_service + feature_registry_service + featurestore_online_serving_service + featurestore_service + index_endpoint_service + index_service + job_service + match_service + metadata_service + migration_service + model_garden_service + model_service + persistent_resource_service + pipeline_service + prediction_service + schedule_service + specialist_pool_service + tensorboard_service + vizier_service diff --git a/docs/aiplatform_v1beta1/types_.rst b/docs/aiplatform_v1beta1/types_.rst new file mode 100644 index 0000000000..19bab68ada --- /dev/null +++ b/docs/aiplatform_v1beta1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform v1beta1 API +============================================= + +.. automodule:: google.cloud.aiplatform_v1beta1.types + :members: + :show-inheritance: diff --git a/docs/definition_v1/services_.rst b/docs/definition_v1/services_.rst new file mode 100644 index 0000000000..ba6b1940e8 --- /dev/null +++ b/docs/definition_v1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1 Schema Trainingjob Definition v1 API +============================================================================ +.. toctree:: + :maxdepth: 2 diff --git a/docs/definition_v1/types_.rst b/docs/definition_v1/types_.rst new file mode 100644 index 0000000000..0add260eee --- /dev/null +++ b/docs/definition_v1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1 Schema Trainingjob Definition v1 API +========================================================================= + +.. automodule:: google.cloud.aiplatform.v1.schema.trainingjob.definition_v1.types + :members: + :show-inheritance: diff --git a/docs/definition_v1beta1/services_.rst b/docs/definition_v1beta1/services_.rst new file mode 100644 index 0000000000..5f1ed5f2b7 --- /dev/null +++ b/docs/definition_v1beta1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1beta1 Schema Trainingjob Definition v1beta1 API +====================================================================================== +.. toctree:: + :maxdepth: 2 diff --git a/docs/definition_v1beta1/types_.rst b/docs/definition_v1beta1/types_.rst new file mode 100644 index 0000000000..3f351d03fc --- /dev/null +++ b/docs/definition_v1beta1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1beta1 Schema Trainingjob Definition v1beta1 API +=================================================================================== + +.. automodule:: google.cloud.aiplatform.v1beta1.schema.trainingjob.definition_v1beta1.types + :members: + :show-inheritance: diff --git a/docs/instance_v1/services_.rst b/docs/instance_v1/services_.rst new file mode 100644 index 0000000000..50c011c69a --- /dev/null +++ b/docs/instance_v1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1 Schema Predict Instance v1 API +====================================================================== +.. toctree:: + :maxdepth: 2 diff --git a/docs/instance_v1/types_.rst b/docs/instance_v1/types_.rst new file mode 100644 index 0000000000..81597999f2 --- /dev/null +++ b/docs/instance_v1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1 Schema Predict Instance v1 API +=================================================================== + +.. automodule:: google.cloud.aiplatform.v1.schema.predict.instance_v1.types + :members: + :show-inheritance: diff --git a/docs/instance_v1beta1/services_.rst b/docs/instance_v1beta1/services_.rst new file mode 100644 index 0000000000..941dbcca59 --- /dev/null +++ b/docs/instance_v1beta1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1beta1 Schema Predict Instance v1beta1 API +================================================================================ +.. toctree:: + :maxdepth: 2 diff --git a/docs/instance_v1beta1/types_.rst b/docs/instance_v1beta1/types_.rst new file mode 100644 index 0000000000..c52ae4800c --- /dev/null +++ b/docs/instance_v1beta1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1beta1 Schema Predict Instance v1beta1 API +============================================================================= + +.. automodule:: google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types + :members: + :show-inheritance: diff --git a/docs/params_v1/services_.rst b/docs/params_v1/services_.rst new file mode 100644 index 0000000000..bf08ea6e98 --- /dev/null +++ b/docs/params_v1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1 Schema Predict Params v1 API +==================================================================== +.. toctree:: + :maxdepth: 2 diff --git a/docs/params_v1/types_.rst b/docs/params_v1/types_.rst new file mode 100644 index 0000000000..afc962c218 --- /dev/null +++ b/docs/params_v1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1 Schema Predict Params v1 API +================================================================= + +.. automodule:: google.cloud.aiplatform.v1.schema.predict.params_v1.types + :members: + :show-inheritance: diff --git a/docs/params_v1beta1/services_.rst b/docs/params_v1beta1/services_.rst new file mode 100644 index 0000000000..b3b897a0f4 --- /dev/null +++ b/docs/params_v1beta1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1beta1 Schema Predict Params v1beta1 API +============================================================================== +.. toctree:: + :maxdepth: 2 diff --git a/docs/params_v1beta1/types_.rst b/docs/params_v1beta1/types_.rst new file mode 100644 index 0000000000..ce7a29cb01 --- /dev/null +++ b/docs/params_v1beta1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1beta1 Schema Predict Params v1beta1 API +=========================================================================== + +.. automodule:: google.cloud.aiplatform.v1beta1.schema.predict.params_v1beta1.types + :members: + :show-inheritance: diff --git a/docs/prediction_v1/services_.rst b/docs/prediction_v1/services_.rst new file mode 100644 index 0000000000..ad6f034387 --- /dev/null +++ b/docs/prediction_v1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1 Schema Predict Prediction v1 API +======================================================================== +.. toctree:: + :maxdepth: 2 diff --git a/docs/prediction_v1/types_.rst b/docs/prediction_v1/types_.rst new file mode 100644 index 0000000000..739ca93799 --- /dev/null +++ b/docs/prediction_v1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1 Schema Predict Prediction v1 API +===================================================================== + +.. automodule:: google.cloud.aiplatform.v1.schema.predict.prediction_v1.types + :members: + :show-inheritance: diff --git a/docs/prediction_v1beta1/services_.rst b/docs/prediction_v1beta1/services_.rst new file mode 100644 index 0000000000..6de5e17520 --- /dev/null +++ b/docs/prediction_v1beta1/services_.rst @@ -0,0 +1,4 @@ +Services for Google Cloud Aiplatform V1beta1 Schema Predict Prediction v1beta1 API +================================================================================== +.. toctree:: + :maxdepth: 2 diff --git a/docs/prediction_v1beta1/types_.rst b/docs/prediction_v1beta1/types_.rst new file mode 100644 index 0000000000..cdbe7f2842 --- /dev/null +++ b/docs/prediction_v1beta1/types_.rst @@ -0,0 +1,6 @@ +Types for Google Cloud Aiplatform V1beta1 Schema Predict Prediction v1beta1 API +=============================================================================== + +.. automodule:: google.cloud.aiplatform.v1beta1.schema.predict.prediction_v1beta1.types + :members: + :show-inheritance: diff --git a/google/cloud/aiplatform_v1/gapic_metadata.json b/google/cloud/aiplatform_v1/gapic_metadata.json index 481256e086..7137ea8899 100644 --- a/google/cloud/aiplatform_v1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1/gapic_metadata.json @@ -1975,6 +1975,90 @@ } } }, + "ScheduleService": { + "clients": { + "grpc": { + "libraryClient": "ScheduleServiceClient", + "rpcs": { + "CreateSchedule": { + "methods": [ + "create_schedule" + ] + }, + "DeleteSchedule": { + "methods": [ + "delete_schedule" + ] + }, + "GetSchedule": { + "methods": [ + "get_schedule" + ] + }, + "ListSchedules": { + "methods": [ + "list_schedules" + ] + }, + "PauseSchedule": { + "methods": [ + "pause_schedule" + ] + }, + "ResumeSchedule": { + "methods": [ + "resume_schedule" + ] + }, + "UpdateSchedule": { + "methods": [ + "update_schedule" + ] + } + } + }, + "grpc-async": { + "libraryClient": "ScheduleServiceAsyncClient", + "rpcs": { + "CreateSchedule": { + "methods": [ + "create_schedule" + ] + }, + "DeleteSchedule": { + "methods": [ + "delete_schedule" + ] + }, + "GetSchedule": { + "methods": [ + "get_schedule" + ] + }, + "ListSchedules": { + "methods": [ + "list_schedules" + ] + }, + "PauseSchedule": { + "methods": [ + "pause_schedule" + ] + }, + "ResumeSchedule": { + "methods": [ + "resume_schedule" + ] + }, + "UpdateSchedule": { + "methods": [ + "update_schedule" + ] + } + } + } + } + }, "SpecialistPoolService": { "clients": { "grpc": { diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index ec924555fe..6f737a3810 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -230,40 +230,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod diff --git a/google/cloud/aiplatform_v1/types/__init__.py b/google/cloud/aiplatform_v1/types/__init__.py index 14603a1447..7709740465 100644 --- a/google/cloud/aiplatform_v1/types/__init__.py +++ b/google/cloud/aiplatform_v1/types/__init__.py @@ -559,6 +559,30 @@ from .service_networking import ( PrivateServiceConnectConfig, ) + +from .publisher_model import ( + PublisherModel, +) +from .saved_query import ( + SavedQuery, +) +from .schedule import ( + Schedule, +) +from .schedule_service import ( + CreateScheduleRequest, + DeleteScheduleRequest, + GetScheduleRequest, + ListSchedulesRequest, + ListSchedulesResponse, + PauseScheduleRequest, + ResumeScheduleRequest, + UpdateScheduleRequest, +) +from .service_networking import ( + PrivateServiceConnectConfig, +) + from .specialist_pool import ( SpecialistPool, ) diff --git a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/async_client.py index f64a8e0510..00135fb2f7 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/async_client.py @@ -1035,7 +1035,7 @@ async def sample_create_feature(): response, self._client._transport.operations_client, gca_feature.Feature, - metadata_type=feature_registry_service.CreateRegistryFeatureOperationMetadata, + metadata_type=featurestore_service.CreateFeatureOperationMetadata, ) # Done; return the response. diff --git a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/client.py b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/client.py index b7a71b4f6d..c1ef0d14c3 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/client.py @@ -1281,7 +1281,7 @@ def sample_create_feature(): response, self._transport.operations_client, gca_feature.Feature, - metadata_type=feature_registry_service.CreateRegistryFeatureOperationMetadata, + metadata_type=featurestore_service.CreateFeatureOperationMetadata, ) # Done; return the response. diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/client.py b/google/cloud/aiplatform_v1beta1/services/migration_service/client.py index 55a32d1c1b..31dce2992e 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/client.py @@ -227,6 +227,23 @@ def parse_dataset_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def dataset_path( + project: str, + dataset: str, + ) -> str: + """Returns a fully-qualified dataset string.""" + return "projects/{project}/datasets/{dataset}".format( + project=project, + dataset=dataset, + ) + + @staticmethod + def parse_dataset_path(path: str) -> Dict[str, str]: + """Parses a dataset path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + return m.groupdict() if m else {} + @staticmethod def dataset_path( project: str, @@ -252,18 +269,23 @@ def parse_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod diff --git a/google/cloud/aiplatform_v1beta1/types/feature_online_store.py b/google/cloud/aiplatform_v1beta1/types/feature_online_store.py index e15989a3c5..9f35aa29d6 100644 --- a/google/cloud/aiplatform_v1beta1/types/feature_online_store.py +++ b/google/cloud/aiplatform_v1beta1/types/feature_online_store.py @@ -19,6 +19,7 @@ import proto # type: ignore +from google.cloud.aiplatform_v1beta1.types import service_networking from google.protobuf import timestamp_pb2 # type: ignore @@ -35,6 +36,10 @@ class FeatureOnlineStore(proto.Message): repository for serving ML features and embedding indexes at low latency. The Feature Online Store is a top-level container. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -45,6 +50,16 @@ class FeatureOnlineStore(proto.Message): featureValues for all FeatureViews under this FeatureOnlineStore. + This field is a member of `oneof`_ ``storage_type``. + optimized (google.cloud.aiplatform_v1beta1.types.FeatureOnlineStore.Optimized): + Contains settings for the Optimized store that will be + created to serve featureValues for all FeatureViews under + this FeatureOnlineStore. When choose Optimized storage type, + need to set + [PrivateServiceConnectConfig.enable_private_service_connect][google.cloud.aiplatform.v1beta1.PrivateServiceConnectConfig.enable_private_service_connect] + to use private endpoint. Otherwise will use public endpoint + by default. + This field is a member of `oneof`_ ``storage_type``. name (str): Output only. Name of the FeatureOnlineStore. Format: @@ -161,20 +176,45 @@ class AutoScaling(proto.Message): message="FeatureOnlineStore.Bigtable.AutoScaling", ) + class Optimized(proto.Message): + r"""Optimized storage type to replace lightning""" + class DedicatedServingEndpoint(proto.Message): r"""The dedicated serving endpoint for this FeatureOnlineStore. + Only need to set when you choose Optimized storage type or + enable EmbeddingManagement. Will use public endpoint by default. Attributes: public_endpoint_domain_name (str): Output only. This field will be populated with the domain name to use for this FeatureOnlineStore + private_service_connect_config (google.cloud.aiplatform_v1beta1.types.PrivateServiceConnectConfig): + Optional. Private service connect config. If + [PrivateServiceConnectConfig.enable_private_service_connect][google.cloud.aiplatform.v1beta1.PrivateServiceConnectConfig.enable_private_service_connect] + set to true, customers will use private service connection + to send request. Otherwise, the connection will set to + public endpoint. + service_attachment (str): + Output only. The name of the service + attachment resource. Populated if private + service connect is enabled and after + FeatureViewSync is created. """ public_endpoint_domain_name: str = proto.Field( proto.STRING, number=2, ) + private_service_connect_config: service_networking.PrivateServiceConnectConfig = proto.Field( + proto.MESSAGE, + number=3, + message=service_networking.PrivateServiceConnectConfig, + ) + service_attachment: str = proto.Field( + proto.STRING, + number=4, + ) class EmbeddingManagement(proto.Message): r"""Contains settings for embedding management. @@ -198,6 +238,12 @@ class EmbeddingManagement(proto.Message): oneof="storage_type", message=Bigtable, ) + optimized: Optimized = proto.Field( + proto.MESSAGE, + number=12, + oneof="storage_type", + message=Optimized, + ) name: str = proto.Field( proto.STRING, number=1, diff --git a/google/cloud/aiplatform_v1beta1/types/prediction_service.py b/google/cloud/aiplatform_v1beta1/types/prediction_service.py index fd6b807e14..7b9e12444d 100644 --- a/google/cloud/aiplatform_v1beta1/types/prediction_service.py +++ b/google/cloud/aiplatform_v1beta1/types/prediction_service.py @@ -290,6 +290,14 @@ class ExplainRequest(proto.Message): methods to reduce approximate errors; - Using different baselines for explaining the prediction results. + concurrent_explanation_spec_override (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.ExplanationSpecOverride]): + Optional. This field is the same as the one above, but + supports multiple explanations to occur in parallel. The key + can be any string. Each override will be run against the + model, then its explanations will be grouped together. + + Note - these explanations are run **In Addition** to the + default Explanation in the deployed model. deployed_model_id (str): If specified, this ExplainRequest will be served by the chosen DeployedModel, overriding @@ -315,6 +323,14 @@ class ExplainRequest(proto.Message): number=5, message=explanation.ExplanationSpecOverride, ) + concurrent_explanation_spec_override: MutableMapping[ + str, explanation.ExplanationSpecOverride + ] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=6, + message=explanation.ExplanationSpecOverride, + ) deployed_model_id: str = proto.Field( proto.STRING, number=3, @@ -333,6 +349,10 @@ class ExplainResponse(proto.Message): It has the same number of elements as [instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] to be explained. + concurrent_explanations (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.ExplainResponse.ConcurrentExplanation]): + This field stores the results of the + explanations run in parallel with the default + explanation strategy/method. deployed_model_id (str): ID of the Endpoint's DeployedModel that served this explanation. @@ -342,11 +362,38 @@ class ExplainResponse(proto.Message): [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]. """ + class ConcurrentExplanation(proto.Message): + r"""This message is a wrapper grouping Concurrent Explanations. + + Attributes: + explanations (MutableSequence[google.cloud.aiplatform_v1beta1.types.Explanation]): + The explanations of the Model's + [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]. + + It has the same number of elements as + [instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] + to be explained. + """ + + explanations: MutableSequence[explanation.Explanation] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=explanation.Explanation, + ) + explanations: MutableSequence[explanation.Explanation] = proto.RepeatedField( proto.MESSAGE, number=1, message=explanation.Explanation, ) + concurrent_explanations: MutableMapping[ + str, ConcurrentExplanation + ] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=4, + message=ConcurrentExplanation, + ) deployed_model_id: str = proto.Field( proto.STRING, number=2, diff --git a/tests/unit/gapic/aiplatform_v1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1/test_migration_service.py index ed1cd95f39..c85deda21c 100644 --- a/tests/unit/gapic/aiplatform_v1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_migration_service.py @@ -2032,19 +2032,22 @@ def test_parse_dataset_path(): def test_dataset_path(): project = "squid" - dataset = "clam" - expected = "projects/{project}/datasets/{dataset}".format( + location = "clam" + dataset = "whelk" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "whelk", - "dataset": "octopus", + "project": "octopus", + "location": "oyster", + "dataset": "nudibranch", } path = MigrationServiceClient.dataset_path(**expected) @@ -2054,22 +2057,19 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "oyster" - location = "nudibranch" - dataset = "cuttlefish" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + project = "cuttlefish" + dataset = "mussel" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "mussel", - "location": "winkle", + "project": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_feature_online_store_admin_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_feature_online_store_admin_service.py index 60647315dd..b11bba9ffa 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_feature_online_store_admin_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_feature_online_store_admin_service.py @@ -62,6 +62,7 @@ from google.cloud.aiplatform_v1beta1.types import feature_view as gca_feature_view from google.cloud.aiplatform_v1beta1.types import feature_view_sync from google.cloud.aiplatform_v1beta1.types import operation as gca_operation +from google.cloud.aiplatform_v1beta1.types import service_networking from google.cloud.location import locations_pb2 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py index b287e8fe7f..c56b99ac1b 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py @@ -2034,8 +2034,31 @@ def test_parse_dataset_path(): def test_dataset_path(): project = "squid" - location = "clam" - dataset = "whelk" + dataset = "clam" + expected = "projects/{project}/datasets/{dataset}".format( + project=project, + dataset=dataset, + ) + actual = MigrationServiceClient.dataset_path(project, dataset) + assert expected == actual + + +def test_parse_dataset_path(): + expected = { + "project": "whelk", + "dataset": "octopus", + } + path = MigrationServiceClient.dataset_path(**expected) + + # Check that the path construction is reversible. + actual = MigrationServiceClient.parse_dataset_path(path) + assert expected == actual + + +def test_dataset_path(): + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, location=location, @@ -2047,9 +2070,9 @@ def test_dataset_path(): def test_parse_dataset_path(): expected = { - "project": "octopus", - "location": "oyster", - "dataset": "nudibranch", + "project": "mussel", + "location": "winkle", + "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) @@ -2059,19 +2082,48 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "cuttlefish" - dataset = "mussel" - expected = "projects/{project}/datasets/{dataset}".format( + project = "scallop" + location = "abalone" + dataset = "squid" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "winkle", + "project": "clam", + "location": "whelk", + "dataset": "octopus", + } + path = MigrationServiceClient.dataset_path(**expected) + + # Check that the path construction is reversible. + actual = MigrationServiceClient.parse_dataset_path(path) + assert expected == actual + + +def test_dataset_path(): + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + project=project, + location=location, + dataset=dataset, + ) + actual = MigrationServiceClient.dataset_path(project, location, dataset) + assert expected == actual + + +def test_parse_dataset_path(): + expected = { + "project": "mussel", + "location": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected)