GeezerVison is showing github.com — feat: add model_source_info to Model in aiplatform v1beta1 model.prot… · googleapis/python-aiplatform@876fb2a
File treeExpand file treeCollapse file tree Open diff view settings services/migration_service
tests/unit/gapic/aiplatform_v1beta1
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/__init__.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 333 | 333 | from .types.migration_service import SearchMigratableResourcesResponse | 334 | 334 | from .types.model import Model | 335 | 335 | from .types.model import ModelContainerSpec | | 336 | +from .types.model import ModelSourceInfo | 336 | 337 | from .types.model import Port | 337 | 338 | from .types.model import PredictSchemata | 338 | 339 | from .types.model_deployment_monitoring_job import ( | | 857 | 858 | "ModelMonitoringObjectiveConfig", | 858 | 859 | "ModelMonitoringStatsAnomalies", | 859 | 860 | "ModelServiceClient", | | 861 | + "ModelSourceInfo", | 860 | 862 | "MutateDeployedIndexOperationMetadata", | 861 | 863 | "MutateDeployedIndexRequest", | 862 | 864 | "MutateDeployedIndexResponse", | |
Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/types/__init__.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 384 | 384 | from .model import ( | 385 | 385 | Model, | 386 | 386 | ModelContainerSpec, | | 387 | + ModelSourceInfo, | 387 | 388 | Port, | 388 | 389 | PredictSchemata, | 389 | 390 | ) | | 885 | 886 | "SearchMigratableResourcesResponse", | 886 | 887 | "Model", | 887 | 888 | "ModelContainerSpec", | | 889 | + "ModelSourceInfo", | 888 | 890 | "Port", | 889 | 891 | "PredictSchemata", | 890 | 892 | "ModelDeploymentMonitoringBigQueryTable", | |
Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/types/model.py +33Lines changed: 33 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | "PredictSchemata", | 31 | 31 | "ModelContainerSpec", | 32 | 32 | "Port", | | 33 | + "ModelSourceInfo", | 33 | 34 | }, | 34 | 35 | ) | 35 | 36 |
| @@ -274,6 +275,11 @@ class Model(proto.Message): | 274 | 275 | Customer-managed encryption key spec for a | 275 | 276 | Model. If set, this Model and all sub-resources | 276 | 277 | 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. | 277 | 283 | """ | 278 | 284 |
| 279 | 285 | class DeploymentResourcesType(proto.Enum): | @@ -443,6 +449,11 @@ class ExportableContent(proto.Enum): | 443 | 449 | number=24, | 444 | 450 | message=gca_encryption_spec.EncryptionSpec, | 445 | 451 | ) | | 452 | + model_source_info = proto.Field( | | 453 | + proto.MESSAGE, | | 454 | + number=38, | | 455 | + message="ModelSourceInfo", | | 456 | + ) | 446 | 457 |
| 447 | 458 |
| 448 | 459 | class PredictSchemata(proto.Message): | @@ -800,4 +811,26 @@ class Port(proto.Message): | 800 | 811 | ) | 801 | 812 |
| 802 | 813 |
| | 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 | + | 803 | 836 | __all__ = tuple(sorted(__protobuf__.manifest)) |
Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1beta1/__init__.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 362 | 362 | from .types.migration_service import SearchMigratableResourcesResponse | 363 | 363 | from .types.model import Model | 364 | 364 | from .types.model import ModelContainerSpec | | 365 | +from .types.model import ModelSourceInfo | 365 | 366 | from .types.model import Port | 366 | 367 | from .types.model import PredictSchemata | 367 | 368 | from .types.model_deployment_monitoring_job import ( | | 905 | 906 | "ModelMonitoringObjectiveConfig", | 906 | 907 | "ModelMonitoringStatsAnomalies", | 907 | 908 | "ModelServiceClient", | | 909 | + "ModelSourceInfo", | 908 | 910 | "MutateDeployedIndexOperationMetadata", | 909 | 911 | "MutateDeployedIndexRequest", | 910 | 912 | "MutateDeployedIndexResponse", | |
Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1beta1/services/migration_service/client.py +9-9Lines changed: 9 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -218,40 +218,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]: | 218 | 218 | @staticmethod | 219 | 219 | def dataset_path( | 220 | 220 | project: str, | 221 | | - location: str, | 222 | 221 | dataset: str, | 223 | 222 | ) -> str: | 224 | 223 | """Returns a fully-qualified dataset string.""" | 225 | | - return "projects/{project}/locations/{location}/datasets/{dataset}".format( | | 224 | + return "projects/{project}/datasets/{dataset}".format( | 226 | 225 | project=project, | 227 | | - location=location, | 228 | 226 | dataset=dataset, | 229 | 227 | ) | 230 | 228 |
| 231 | 229 | @staticmethod | 232 | 230 | def parse_dataset_path(path: str) -> Dict[str, str]: | 233 | 231 | """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) | 238 | 233 | return m.groupdict() if m else {} | 239 | 234 |
| 240 | 235 | @staticmethod | 241 | 236 | def dataset_path( | 242 | 237 | project: str, | | 238 | + location: str, | 243 | 239 | dataset: str, | 244 | 240 | ) -> str: | 245 | 241 | """Returns a fully-qualified dataset string.""" | 246 | | - return "projects/{project}/datasets/{dataset}".format( | | 242 | + return "projects/{project}/locations/{location}/datasets/{dataset}".format( | 247 | 243 | project=project, | | 244 | + location=location, | 248 | 245 | dataset=dataset, | 249 | 246 | ) | 250 | 247 |
| 251 | 248 | @staticmethod | 252 | 249 | def parse_dataset_path(path: str) -> Dict[str, str]: | 253 | 250 | """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 | + ) | 255 | 255 | return m.groupdict() if m else {} | 256 | 256 |
| 257 | 257 | @staticmethod | |
Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1beta1/types/__init__.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 407 | 407 | from .model import ( | 408 | 408 | Model, | 409 | 409 | ModelContainerSpec, | | 410 | + ModelSourceInfo, | 410 | 411 | Port, | 411 | 412 | PredictSchemata, | 412 | 413 | ) | | 931 | 932 | "SearchMigratableResourcesResponse", | 932 | 933 | "Model", | 933 | 934 | "ModelContainerSpec", | | 935 | + "ModelSourceInfo", | 934 | 936 | "Port", | 935 | 937 | "PredictSchemata", | 936 | 938 | "ModelDeploymentMonitoringBigQueryTable", | |
Collapse file Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1beta1/types/model.py +33Lines changed: 33 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | "PredictSchemata", | 31 | 31 | "ModelContainerSpec", | 32 | 32 | "Port", | | 33 | + "ModelSourceInfo", | 33 | 34 | }, | 34 | 35 | ) | 35 | 36 |
| @@ -274,6 +275,11 @@ class Model(proto.Message): | 274 | 275 | Customer-managed encryption key spec for a | 275 | 276 | Model. If set, this Model and all sub-resources | 276 | 277 | 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. | 277 | 283 | """ | 278 | 284 |
| 279 | 285 | class DeploymentResourcesType(proto.Enum): | @@ -443,6 +449,11 @@ class ExportableContent(proto.Enum): | 443 | 449 | number=24, | 444 | 450 | message=gca_encryption_spec.EncryptionSpec, | 445 | 451 | ) | | 452 | + model_source_info = proto.Field( | | 453 | + proto.MESSAGE, | | 454 | + number=38, | | 455 | + message="ModelSourceInfo", | | 456 | + ) | 446 | 457 |
| 447 | 458 |
| 448 | 459 | class PredictSchemata(proto.Message): | @@ -800,4 +811,26 @@ class Port(proto.Message): | 800 | 811 | ) | 801 | 812 |
| 802 | 813 |
| | 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 | + | 803 | 836 | __all__ = tuple(sorted(__protobuf__.manifest)) |
Collapse file Copy file name to clipboardExpand all lines: tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py +13-13Lines changed: 13 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2032,22 +2032,19 @@ def test_parse_dataset_path(): | 2032 | 2032 |
| 2033 | 2033 | def test_dataset_path(): | 2034 | 2034 | 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( | 2038 | 2037 | project=project, | 2039 | | - location=location, | 2040 | 2038 | dataset=dataset, | 2041 | 2039 | ) | 2042 | | - actual = MigrationServiceClient.dataset_path(project, location, dataset) | | 2040 | + actual = MigrationServiceClient.dataset_path(project, dataset) | 2043 | 2041 | assert expected == actual | 2044 | 2042 |
| 2045 | 2043 |
| 2046 | 2044 | def test_parse_dataset_path(): | 2047 | 2045 | expected = { | 2048 | | - "project": "octopus", | 2049 | | - "location": "oyster", | 2050 | | - "dataset": "nudibranch", | | 2046 | + "project": "whelk", | | 2047 | + "dataset": "octopus", | 2051 | 2048 | } | 2052 | 2049 | path = MigrationServiceClient.dataset_path(**expected) | 2053 | 2050 |
| @@ -2057,19 +2054,22 @@ def test_parse_dataset_path(): | 2057 | 2054 |
| 2058 | 2055 |
| 2059 | 2056 | 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( | 2063 | 2061 | project=project, | | 2062 | + location=location, | 2064 | 2063 | dataset=dataset, | 2065 | 2064 | ) | 2066 | | - actual = MigrationServiceClient.dataset_path(project, dataset) | | 2065 | + actual = MigrationServiceClient.dataset_path(project, location, dataset) | 2067 | 2066 | assert expected == actual | 2068 | 2067 |
| 2069 | 2068 |
| 2070 | 2069 | def test_parse_dataset_path(): | 2071 | 2070 | expected = { | 2072 | | - "project": "winkle", | | 2071 | + "project": "mussel", | | 2072 | + "location": "winkle", | 2073 | 2073 | "dataset": "nautilus", | 2074 | 2074 | } | 2075 | 2075 | path = MigrationServiceClient.dataset_path(**expected) | |
|