Skip to content

Commit 9a5c4be

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- eacdcb5 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest PiperOrigin-RevId: 522096199 Source-Link: googleapis/googleapis@d9592ed Source-Link: googleapis/googleapis-gen@0ab428e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGFiNDI4ZTM5MzQ5ODFkYjljOGM3YmYxN2IxZmVhNWQ3NDY4MmFmYiJ9 -- 040ae79 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 886f845 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add notification_channels in aiplatform v1beta1 model_monitoring.proto PiperOrigin-RevId: 523180073 Source-Link: googleapis/googleapis@a793ce3 Source-Link: googleapis/googleapis-gen@c904f38 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzkwNGYzODFhZDIwZDM3M2NiOTFiZjY4N2I5MzJmNmY0OGE4ZjBiOSJ9 -- 778d132 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 3da4800 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: chore: Provide .NET-specific generator settings PiperOrigin-RevId: 523994764 Source-Link: googleapis/googleapis@b346628 Source-Link: googleapis/googleapis-gen@a42e2f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTQyZTJmOTI2NjY0MTYwZDQ5NjZmODQxOTlkODQ4YjlhNzkzNDdiMSJ9 -- b1367f4 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- ffaaee9 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add is_default to Tensorboard in aiplatform v1 tensorboard.proto and v1beta1 tensorboard.proto PiperOrigin-RevId: 524384228 Source-Link: googleapis/googleapis@6774ccb Source-Link: googleapis/googleapis-gen@d80853d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDgwODUzZGY3ODJiOGQzODYzYTIzMzRiYWQ3YzgwOWJmODZmMDBiYiJ9 -- e1613bd by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 6b3ea4e by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add PeeredNetworkIpRange to NetworkConfigs message feat: Add NpmPackages to Artifact and Results messages and new SHA512 hash type docs: Various doc updates Committer: @giangnguyen PiperOrigin-RevId: 525153459 Source-Link: googleapis/googleapis@0c7c7df Source-Link: googleapis/googleapis-gen@8d2d20f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGQyZDIwZjUwYzU4NTc3NWU1MDZiNjFiYjQzZTllNDkyMjc5NTM1NCJ9 -- abd6061 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#2066 from googleapis:owl-bot-copy e3890f1 PiperOrigin-RevId: 525232649
1 parent fd5ff99 commit 9a5c4be

File tree

13 files changed

+138
-51
lines changed

13 files changed

+138
-51
lines changed

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -230,40 +230,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
230230
@staticmethod
231231
def dataset_path(
232232
project: str,
233-
location: str,
234233
dataset: str,
235234
) -> str:
236235
"""Returns a fully-qualified dataset string."""
237-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
236+
return "projects/{project}/datasets/{dataset}".format(
238237
project=project,
239-
location=location,
240238
dataset=dataset,
241239
)
242240

243241
@staticmethod
244242
def parse_dataset_path(path: str) -> Dict[str, str]:
245243
"""Parses a dataset path into its component segments."""
246-
m = re.match(
247-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
248-
path,
249-
)
244+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
250245
return m.groupdict() if m else {}
251246

252247
@staticmethod
253248
def dataset_path(
254249
project: str,
250+
location: str,
255251
dataset: str,
256252
) -> str:
257253
"""Returns a fully-qualified dataset string."""
258-
return "projects/{project}/datasets/{dataset}".format(
254+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
259255
project=project,
256+
location=location,
260257
dataset=dataset,
261258
)
262259

263260
@staticmethod
264261
def parse_dataset_path(path: str) -> Dict[str, str]:
265262
"""Parses a dataset path into its component segments."""
266-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
263+
m = re.match(
264+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
265+
path,
266+
)
267267
return m.groupdict() if m else {}
268268

269269
@staticmethod

google/cloud/aiplatform_v1/types/tensorboard.py

+12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ class Tensorboard(proto.Message):
8484
Used to perform a consistent
8585
read-modify-write updates. If not set, a blind
8686
"overwrite" update happens.
87+
is_default (bool):
88+
Used to indicate if the TensorBoard instance
89+
is the default one. Each project & region can
90+
have at most one default TensorBoard instance.
91+
Creation of a default TensorBoard instance and
92+
updating an existing TensorBoard instance to be
93+
default will mark all other TensorBoard
94+
instances (if any) as non default.
8795
"""
8896

8997
name: str = proto.Field(
@@ -130,6 +138,10 @@ class Tensorboard(proto.Message):
130138
proto.STRING,
131139
number=9,
132140
)
141+
is_default: bool = proto.Field(
142+
proto.BOOL,
143+
number=12,
144+
)
133145

134146

135147
__all__ = tuple(sorted(__protobuf__.manifest))

google/cloud/aiplatform_v1beta1/services/job_service/async_client.py

+4
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ class JobServiceAsyncClient:
137137
)
138138
network_path = staticmethod(JobServiceClient.network_path)
139139
parse_network_path = staticmethod(JobServiceClient.parse_network_path)
140+
notification_channel_path = staticmethod(JobServiceClient.notification_channel_path)
141+
parse_notification_channel_path = staticmethod(
142+
JobServiceClient.parse_notification_channel_path
143+
)
140144
tensorboard_path = staticmethod(JobServiceClient.tensorboard_path)
141145
parse_tensorboard_path = staticmethod(JobServiceClient.parse_tensorboard_path)
142146
trial_path = staticmethod(JobServiceClient.trial_path)

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

+20
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,26 @@ def parse_network_path(path: str) -> Dict[str, str]:
457457
)
458458
return m.groupdict() if m else {}
459459

460+
@staticmethod
461+
def notification_channel_path(
462+
project: str,
463+
notification_channel: str,
464+
) -> str:
465+
"""Returns a fully-qualified notification_channel string."""
466+
return "projects/{project}/notificationChannels/{notification_channel}".format(
467+
project=project,
468+
notification_channel=notification_channel,
469+
)
470+
471+
@staticmethod
472+
def parse_notification_channel_path(path: str) -> Dict[str, str]:
473+
"""Parses a notification_channel path into its component segments."""
474+
m = re.match(
475+
r"^projects/(?P<project>.+?)/notificationChannels/(?P<notification_channel>.+?)$",
476+
path,
477+
)
478+
return m.groupdict() if m else {}
479+
460480
@staticmethod
461481
def tensorboard_path(
462482
project: str,

google/cloud/aiplatform_v1beta1/types/model_monitoring.py

+8
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ class ModelMonitoringAlertConfig(proto.Message):
401401
[google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][].
402402
This can be further sinked to Pub/Sub or any other services
403403
supported by Cloud Logging.
404+
notification_channels (MutableSequence[str]):
405+
Resource names of the NotificationChannels to send alert.
406+
Must be of the format
407+
``projects/<project_id_or_number>/notificationChannels/<channel_id>``
404408
"""
405409

406410
class EmailAlertConfig(proto.Message):
@@ -426,6 +430,10 @@ class EmailAlertConfig(proto.Message):
426430
proto.BOOL,
427431
number=2,
428432
)
433+
notification_channels: MutableSequence[str] = proto.RepeatedField(
434+
proto.STRING,
435+
number=3,
436+
)
429437

430438

431439
class ThresholdConfig(proto.Message):

google/cloud/aiplatform_v1beta1/types/tensorboard.py

+12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ class Tensorboard(proto.Message):
8484
Used to perform a consistent
8585
read-modify-write updates. If not set, a blind
8686
"overwrite" update happens.
87+
is_default (bool):
88+
Used to indicate if the TensorBoard instance
89+
is the default one. Each project & region can
90+
have at most one default TensorBoard instance.
91+
Creation of a default TensorBoard instance and
92+
updating an existing TensorBoard instance to be
93+
default will mark all other TensorBoard
94+
instances (if any) as non default.
8795
"""
8896

8997
name: str = proto.Field(
@@ -130,6 +138,10 @@ class Tensorboard(proto.Message):
130138
proto.STRING,
131139
number=9,
132140
)
141+
is_default: bool = proto.Field(
142+
proto.BOOL,
143+
number=12,
144+
)
133145

134146

135147
__all__ = tuple(sorted(__protobuf__.manifest))

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def system(session):
255255
if system_test_folder_exists:
256256
session.run(
257257
"py.test",
258-
"-v", # TODO(b/275569167) revert this flag once bug is fixed
258+
"--quiet",
259259
f"--junitxml=system_{session.python}_sponge_log.xml",
260260
system_test_folder_path,
261261
*session.posargs,

samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.24.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.24.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

tests/unit/gapic/aiplatform_v1/test_migration_service.py

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

20312031
def test_dataset_path():
20322032
project = "squid"
2033-
location = "clam"
2034-
dataset = "whelk"
2035-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
2033+
dataset = "clam"
2034+
expected = "projects/{project}/datasets/{dataset}".format(
20362035
project=project,
2037-
location=location,
20382036
dataset=dataset,
20392037
)
2040-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
2038+
actual = MigrationServiceClient.dataset_path(project, dataset)
20412039
assert expected == actual
20422040

20432041

20442042
def test_parse_dataset_path():
20452043
expected = {
2046-
"project": "octopus",
2047-
"location": "oyster",
2048-
"dataset": "nudibranch",
2044+
"project": "whelk",
2045+
"dataset": "octopus",
20492046
}
20502047
path = MigrationServiceClient.dataset_path(**expected)
20512048

@@ -2055,19 +2052,22 @@ def test_parse_dataset_path():
20552052

20562053

20572054
def test_dataset_path():
2058-
project = "cuttlefish"
2059-
dataset = "mussel"
2060-
expected = "projects/{project}/datasets/{dataset}".format(
2055+
project = "oyster"
2056+
location = "nudibranch"
2057+
dataset = "cuttlefish"
2058+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
20612059
project=project,
2060+
location=location,
20622061
dataset=dataset,
20632062
)
2064-
actual = MigrationServiceClient.dataset_path(project, dataset)
2063+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
20652064
assert expected == actual
20662065

20672066

20682067
def test_parse_dataset_path():
20692068
expected = {
2070-
"project": "winkle",
2069+
"project": "mussel",
2070+
"location": "winkle",
20712071
"dataset": "nautilus",
20722072
}
20732073
path = MigrationServiceClient.dataset_path(**expected)

tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py

+4
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"):
10071007
blob_storage_path_prefix="blob_storage_path_prefix_value",
10081008
run_count=989,
10091009
etag="etag_value",
1010+
is_default=True,
10101011
)
10111012
response = client.get_tensorboard(request)
10121013

@@ -1023,6 +1024,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"):
10231024
assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value"
10241025
assert response.run_count == 989
10251026
assert response.etag == "etag_value"
1027+
assert response.is_default is True
10261028

10271029

10281030
def test_get_tensorboard_empty_call():
@@ -1066,6 +1068,7 @@ async def test_get_tensorboard_async(
10661068
blob_storage_path_prefix="blob_storage_path_prefix_value",
10671069
run_count=989,
10681070
etag="etag_value",
1071+
is_default=True,
10691072
)
10701073
)
10711074
response = await client.get_tensorboard(request)
@@ -1083,6 +1086,7 @@ async def test_get_tensorboard_async(
10831086
assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value"
10841087
assert response.run_count == 989
10851088
assert response.etag == "etag_value"
1089+
assert response.is_default is True
10861090

10871091

10881092
@pytest.mark.asyncio

0 commit comments

Comments
 (0)