Skip to content

Commit 876fb2a

Browse files
gcf-owl-bot[bot]partheadizcologygcf-merge-on-green[bot]
authored
feat: add model_source_info to Model in aiplatform v1beta1 model.proto (#1691)
* feat: release SensitiveAction Cloud Logging payload to v1 PiperOrigin-RevId: 476083958 Source-Link: googleapis/googleapis@fafd03f Source-Link: googleapis/googleapis-gen@79c1b9c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzljMWI5Y2UyNDMzNzQ3MzU2NTFlNzJjZGViY2JlZDk5ZjVlNGU2NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add model_source_info to Model in aiplatform v1 model.proto PiperOrigin-RevId: 476193748 Source-Link: googleapis/googleapis@a7f3890 Source-Link: googleapis/googleapis-gen@5589b93 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4OWI5MzEwYTZlZDI2YjU2ODE0NjFjNDc2ZDU3MzcyYWNkMTI2NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add model_source_info to Model in aiplatform v1beta1 model.proto PiperOrigin-RevId: 476411826 Source-Link: googleapis/googleapis@72f0faa Source-Link: googleapis/googleapis-gen@7909f5b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzkwOWY1YjFkNTEzNDlkY2VmYmUzNzBmNmE0ODg5ODFiODBjMWJmZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add an enum value for raw locations from Apple platforms PiperOrigin-RevId: 476961484 Source-Link: googleapis/googleapis@695134b Source-Link: googleapis/googleapis-gen@49457f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDk0NTdmOWU3YWFlODljZmUwNDkxYWY0ZGJkOTk2MWE5MDEyNWQzMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]> Co-authored-by: Yu-Han Liu <[email protected]> Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>
1 parent 05efff7 commit 876fb2a

File tree

8 files changed

+96
-22
lines changed

8 files changed

+96
-22
lines changed

google/cloud/aiplatform_v1/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@
333333
from .types.migration_service import SearchMigratableResourcesResponse
334334
from .types.model import Model
335335
from .types.model import ModelContainerSpec
336+
from .types.model import ModelSourceInfo
336337
from .types.model import Port
337338
from .types.model import PredictSchemata
338339
from .types.model_deployment_monitoring_job import (
@@ -857,6 +858,7 @@
857858
"ModelMonitoringObjectiveConfig",
858859
"ModelMonitoringStatsAnomalies",
859860
"ModelServiceClient",
861+
"ModelSourceInfo",
860862
"MutateDeployedIndexOperationMetadata",
861863
"MutateDeployedIndexRequest",
862864
"MutateDeployedIndexResponse",

google/cloud/aiplatform_v1/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@
384384
from .model import (
385385
Model,
386386
ModelContainerSpec,
387+
ModelSourceInfo,
387388
Port,
388389
PredictSchemata,
389390
)
@@ -885,6 +886,7 @@
885886
"SearchMigratableResourcesResponse",
886887
"Model",
887888
"ModelContainerSpec",
889+
"ModelSourceInfo",
888890
"Port",
889891
"PredictSchemata",
890892
"ModelDeploymentMonitoringBigQueryTable",

google/cloud/aiplatform_v1/types/model.py

+33
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"PredictSchemata",
3131
"ModelContainerSpec",
3232
"Port",
33+
"ModelSourceInfo",
3334
},
3435
)
3536

@@ -274,6 +275,11 @@ class Model(proto.Message):
274275
Customer-managed encryption key spec for a
275276
Model. If set, this Model and all sub-resources
276277
of this Model will be secured by this key.
278+
model_source_info (google.cloud.aiplatform_v1.types.ModelSourceInfo):
279+
Output only. Source of a model. It can either
280+
be automl training pipeline, custom training
281+
pipeline, BigQuery ML, or existing Vertex AI
282+
Model.
277283
"""
278284

279285
class DeploymentResourcesType(proto.Enum):
@@ -443,6 +449,11 @@ class ExportableContent(proto.Enum):
443449
number=24,
444450
message=gca_encryption_spec.EncryptionSpec,
445451
)
452+
model_source_info = proto.Field(
453+
proto.MESSAGE,
454+
number=38,
455+
message="ModelSourceInfo",
456+
)
446457

447458

448459
class PredictSchemata(proto.Message):
@@ -800,4 +811,26 @@ class Port(proto.Message):
800811
)
801812

802813

814+
class ModelSourceInfo(proto.Message):
815+
r"""Detail description of the source information of the model.
816+
817+
Attributes:
818+
source_type (google.cloud.aiplatform_v1.types.ModelSourceInfo.ModelSourceType):
819+
Type of the model source.
820+
"""
821+
822+
class ModelSourceType(proto.Enum):
823+
r"""Source of the model."""
824+
MODEL_SOURCE_TYPE_UNSPECIFIED = 0
825+
AUTOML = 1
826+
CUSTOM = 2
827+
BQML = 3
828+
829+
source_type = proto.Field(
830+
proto.ENUM,
831+
number=1,
832+
enum=ModelSourceType,
833+
)
834+
835+
803836
__all__ = tuple(sorted(__protobuf__.manifest))

google/cloud/aiplatform_v1beta1/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@
362362
from .types.migration_service import SearchMigratableResourcesResponse
363363
from .types.model import Model
364364
from .types.model import ModelContainerSpec
365+
from .types.model import ModelSourceInfo
365366
from .types.model import Port
366367
from .types.model import PredictSchemata
367368
from .types.model_deployment_monitoring_job import (
@@ -905,6 +906,7 @@
905906
"ModelMonitoringObjectiveConfig",
906907
"ModelMonitoringStatsAnomalies",
907908
"ModelServiceClient",
909+
"ModelSourceInfo",
908910
"MutateDeployedIndexOperationMetadata",
909911
"MutateDeployedIndexRequest",
910912
"MutateDeployedIndexResponse",

google/cloud/aiplatform_v1beta1/services/migration_service/client.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -218,40 +218,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
218218
@staticmethod
219219
def dataset_path(
220220
project: str,
221-
location: str,
222221
dataset: str,
223222
) -> str:
224223
"""Returns a fully-qualified dataset string."""
225-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
224+
return "projects/{project}/datasets/{dataset}".format(
226225
project=project,
227-
location=location,
228226
dataset=dataset,
229227
)
230228

231229
@staticmethod
232230
def parse_dataset_path(path: str) -> Dict[str, str]:
233231
"""Parses a dataset path into its component segments."""
234-
m = re.match(
235-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
236-
path,
237-
)
232+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
238233
return m.groupdict() if m else {}
239234

240235
@staticmethod
241236
def dataset_path(
242237
project: str,
238+
location: str,
243239
dataset: str,
244240
) -> str:
245241
"""Returns a fully-qualified dataset string."""
246-
return "projects/{project}/datasets/{dataset}".format(
242+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
247243
project=project,
244+
location=location,
248245
dataset=dataset,
249246
)
250247

251248
@staticmethod
252249
def parse_dataset_path(path: str) -> Dict[str, str]:
253250
"""Parses a dataset path into its component segments."""
254-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
251+
m = re.match(
252+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
253+
path,
254+
)
255255
return m.groupdict() if m else {}
256256

257257
@staticmethod

google/cloud/aiplatform_v1beta1/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@
407407
from .model import (
408408
Model,
409409
ModelContainerSpec,
410+
ModelSourceInfo,
410411
Port,
411412
PredictSchemata,
412413
)
@@ -931,6 +932,7 @@
931932
"SearchMigratableResourcesResponse",
932933
"Model",
933934
"ModelContainerSpec",
935+
"ModelSourceInfo",
934936
"Port",
935937
"PredictSchemata",
936938
"ModelDeploymentMonitoringBigQueryTable",

google/cloud/aiplatform_v1beta1/types/model.py

+33
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"PredictSchemata",
3131
"ModelContainerSpec",
3232
"Port",
33+
"ModelSourceInfo",
3334
},
3435
)
3536

@@ -274,6 +275,11 @@ class Model(proto.Message):
274275
Customer-managed encryption key spec for a
275276
Model. If set, this Model and all sub-resources
276277
of this Model will be secured by this key.
278+
model_source_info (google.cloud.aiplatform_v1beta1.types.ModelSourceInfo):
279+
Output only. Source of a model. It can either
280+
be automl training pipeline, custom training
281+
pipeline, BigQuery ML, or existing Vertex AI
282+
Model.
277283
"""
278284

279285
class DeploymentResourcesType(proto.Enum):
@@ -443,6 +449,11 @@ class ExportableContent(proto.Enum):
443449
number=24,
444450
message=gca_encryption_spec.EncryptionSpec,
445451
)
452+
model_source_info = proto.Field(
453+
proto.MESSAGE,
454+
number=38,
455+
message="ModelSourceInfo",
456+
)
446457

447458

448459
class PredictSchemata(proto.Message):
@@ -800,4 +811,26 @@ class Port(proto.Message):
800811
)
801812

802813

814+
class ModelSourceInfo(proto.Message):
815+
r"""Detail description of the source information of the model.
816+
817+
Attributes:
818+
source_type (google.cloud.aiplatform_v1beta1.types.ModelSourceInfo.ModelSourceType):
819+
Type of the model source.
820+
"""
821+
822+
class ModelSourceType(proto.Enum):
823+
r"""Source of the model."""
824+
MODEL_SOURCE_TYPE_UNSPECIFIED = 0
825+
AUTOML = 1
826+
CUSTOM = 2
827+
BQML = 3
828+
829+
source_type = proto.Field(
830+
proto.ENUM,
831+
number=1,
832+
enum=ModelSourceType,
833+
)
834+
835+
803836
__all__ = tuple(sorted(__protobuf__.manifest))

tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -2032,22 +2032,19 @@ def test_parse_dataset_path():
20322032

20332033
def test_dataset_path():
20342034
project = "squid"
2035-
location = "clam"
2036-
dataset = "whelk"
2037-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
2035+
dataset = "clam"
2036+
expected = "projects/{project}/datasets/{dataset}".format(
20382037
project=project,
2039-
location=location,
20402038
dataset=dataset,
20412039
)
2042-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
2040+
actual = MigrationServiceClient.dataset_path(project, dataset)
20432041
assert expected == actual
20442042

20452043

20462044
def test_parse_dataset_path():
20472045
expected = {
2048-
"project": "octopus",
2049-
"location": "oyster",
2050-
"dataset": "nudibranch",
2046+
"project": "whelk",
2047+
"dataset": "octopus",
20512048
}
20522049
path = MigrationServiceClient.dataset_path(**expected)
20532050

@@ -2057,19 +2054,22 @@ def test_parse_dataset_path():
20572054

20582055

20592056
def test_dataset_path():
2060-
project = "cuttlefish"
2061-
dataset = "mussel"
2062-
expected = "projects/{project}/datasets/{dataset}".format(
2057+
project = "oyster"
2058+
location = "nudibranch"
2059+
dataset = "cuttlefish"
2060+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
20632061
project=project,
2062+
location=location,
20642063
dataset=dataset,
20652064
)
2066-
actual = MigrationServiceClient.dataset_path(project, dataset)
2065+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
20672066
assert expected == actual
20682067

20692068

20702069
def test_parse_dataset_path():
20712070
expected = {
2072-
"project": "winkle",
2071+
"project": "mussel",
2072+
"location": "winkle",
20732073
"dataset": "nautilus",
20742074
}
20752075
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)