Skip to content

Commit

Permalink
Copybara import of the project:
Browse files Browse the repository at this point in the history
--
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
  • Loading branch information
gcf-owl-bot[bot] authored and copybara-github committed Apr 18, 2023
1 parent fd5ff99 commit 9a5c4be
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 51 deletions.
18 changes: 9 additions & 9 deletions google/cloud/aiplatform_v1/services/migration_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}/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<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
path,
)
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", 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}/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<project>.+?)/datasets/(?P<dataset>.+?)$", path)
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
Expand Down
12 changes: 12 additions & 0 deletions google/cloud/aiplatform_v1/types/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ class Tensorboard(proto.Message):
Used to perform a consistent
read-modify-write updates. If not set, a blind
"overwrite" update happens.
is_default (bool):
Used to indicate if the TensorBoard instance
is the default one. Each project & region can
have at most one default TensorBoard instance.
Creation of a default TensorBoard instance and
updating an existing TensorBoard instance to be
default will mark all other TensorBoard
instances (if any) as non default.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -130,6 +138,10 @@ class Tensorboard(proto.Message):
proto.STRING,
number=9,
)
is_default: bool = proto.Field(
proto.BOOL,
number=12,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ class JobServiceAsyncClient:
)
network_path = staticmethod(JobServiceClient.network_path)
parse_network_path = staticmethod(JobServiceClient.parse_network_path)
notification_channel_path = staticmethod(JobServiceClient.notification_channel_path)
parse_notification_channel_path = staticmethod(
JobServiceClient.parse_notification_channel_path
)
tensorboard_path = staticmethod(JobServiceClient.tensorboard_path)
parse_tensorboard_path = staticmethod(JobServiceClient.parse_tensorboard_path)
trial_path = staticmethod(JobServiceClient.trial_path)
Expand Down
20 changes: 20 additions & 0 deletions google/cloud/aiplatform_v1beta1/services/job_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,26 @@ def parse_network_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def notification_channel_path(
project: str,
notification_channel: str,
) -> str:
"""Returns a fully-qualified notification_channel string."""
return "projects/{project}/notificationChannels/{notification_channel}".format(
project=project,
notification_channel=notification_channel,
)

@staticmethod
def parse_notification_channel_path(path: str) -> Dict[str, str]:
"""Parses a notification_channel path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/notificationChannels/(?P<notification_channel>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def tensorboard_path(
project: str,
Expand Down
8 changes: 8 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/model_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ class ModelMonitoringAlertConfig(proto.Message):
[google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][].
This can be further sinked to Pub/Sub or any other services
supported by Cloud Logging.
notification_channels (MutableSequence[str]):
Resource names of the NotificationChannels to send alert.
Must be of the format
``projects/<project_id_or_number>/notificationChannels/<channel_id>``
"""

class EmailAlertConfig(proto.Message):
Expand All @@ -426,6 +430,10 @@ class EmailAlertConfig(proto.Message):
proto.BOOL,
number=2,
)
notification_channels: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=3,
)


class ThresholdConfig(proto.Message):
Expand Down
12 changes: 12 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ class Tensorboard(proto.Message):
Used to perform a consistent
read-modify-write updates. If not set, a blind
"overwrite" update happens.
is_default (bool):
Used to indicate if the TensorBoard instance
is the default one. Each project & region can
have at most one default TensorBoard instance.
Creation of a default TensorBoard instance and
updating an existing TensorBoard instance to be
default will mark all other TensorBoard
instances (if any) as non default.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -130,6 +138,10 @@ class Tensorboard(proto.Message):
proto.STRING,
number=9,
)
is_default: bool = proto.Field(
proto.BOOL,
number=12,
)


__all__ = tuple(sorted(__protobuf__.manifest))
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def system(session):
if system_test_folder_exists:
session.run(
"py.test",
"-v", # TODO(b/275569167) revert this flag once bug is fixed
"--quiet",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-aiplatform",
"version": "1.24.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-aiplatform",
"version": "1.24.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
26 changes: 13 additions & 13 deletions tests/unit/gapic/aiplatform_v1/test_migration_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2030,22 +2030,19 @@ def test_parse_dataset_path():

def test_dataset_path():
project = "squid"
location = "clam"
dataset = "whelk"
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
dataset = "clam"
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": "octopus",
"location": "oyster",
"dataset": "nudibranch",
"project": "whelk",
"dataset": "octopus",
}
path = MigrationServiceClient.dataset_path(**expected)

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


def test_dataset_path():
project = "cuttlefish"
dataset = "mussel"
expected = "projects/{project}/datasets/{dataset}".format(
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, dataset)
actual = MigrationServiceClient.dataset_path(project, location, dataset)
assert expected == actual


def test_parse_dataset_path():
expected = {
"project": "winkle",
"project": "mussel",
"location": "winkle",
"dataset": "nautilus",
}
path = MigrationServiceClient.dataset_path(**expected)
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"):
blob_storage_path_prefix="blob_storage_path_prefix_value",
run_count=989,
etag="etag_value",
is_default=True,
)
response = client.get_tensorboard(request)

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


def test_get_tensorboard_empty_call():
Expand Down Expand Up @@ -1066,6 +1068,7 @@ async def test_get_tensorboard_async(
blob_storage_path_prefix="blob_storage_path_prefix_value",
run_count=989,
etag="etag_value",
is_default=True,
)
)
response = await client.get_tensorboard(request)
Expand All @@ -1083,6 +1086,7 @@ async def test_get_tensorboard_async(
assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value"
assert response.run_count == 989
assert response.etag == "etag_value"
assert response.is_default is True


@pytest.mark.asyncio
Expand Down
Loading

0 comments on commit 9a5c4be

Please sign in to comment.