Skip to content

Commit c97199d

Browse files
feat: Adds support for google.protobuf.Value pipeline parameters in the parameter_values field (#807)
* feat: Adds support for `google.protobuf.Value` pipeline parameters in the `parameter_values` field PiperOrigin-RevId: 406492661 Source-Link: googleapis/googleapis@972abb6 Source-Link: googleapis/googleapis-gen@b6774aa Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY3NzRhYTNiNjFkMDViZjlmMTBhYTlhZjhkNjIzMTEyNzNkMzVhOSJ9 * 🦉 Updates from OwlBot 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: sasha-gitg <44654632+sasha-gitg@users.noreply.github.com>
1 parent 726b620 commit c97199d

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,32 +197,32 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
197197
return m.groupdict() if m else {}
198198

199199
@staticmethod
200-
def dataset_path(project: str, location: str, dataset: str,) -> str:
200+
def dataset_path(project: str, dataset: str,) -> str:
201201
"""Returns a fully-qualified dataset string."""
202-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
203-
project=project, location=location, dataset=dataset,
202+
return "projects/{project}/datasets/{dataset}".format(
203+
project=project, dataset=dataset,
204204
)
205205

206206
@staticmethod
207207
def parse_dataset_path(path: str) -> Dict[str, str]:
208208
"""Parses a dataset path into its component segments."""
209-
m = re.match(
210-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
211-
path,
212-
)
209+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
213210
return m.groupdict() if m else {}
214211

215212
@staticmethod
216-
def dataset_path(project: str, dataset: str,) -> str:
213+
def dataset_path(project: str, location: str, dataset: str,) -> str:
217214
"""Returns a fully-qualified dataset string."""
218-
return "projects/{project}/datasets/{dataset}".format(
219-
project=project, dataset=dataset,
215+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
216+
project=project, location=location, dataset=dataset,
220217
)
221218

222219
@staticmethod
223220
def parse_dataset_path(path: str) -> Dict[str, str]:
224221
"""Parses a dataset path into its component segments."""
225-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
222+
m = re.match(
223+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
224+
path,
225+
)
226226
return m.groupdict() if m else {}
227227

228228
@staticmethod

tests/unit/gapic/aiplatform_v1/test_migration_service.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,20 +1636,18 @@ def test_parse_dataset_path():
16361636

16371637
def test_dataset_path():
16381638
project = "squid"
1639-
location = "clam"
1640-
dataset = "whelk"
1641-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
1642-
project=project, location=location, dataset=dataset,
1639+
dataset = "clam"
1640+
expected = "projects/{project}/datasets/{dataset}".format(
1641+
project=project, dataset=dataset,
16431642
)
1644-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
1643+
actual = MigrationServiceClient.dataset_path(project, dataset)
16451644
assert expected == actual
16461645

16471646

16481647
def test_parse_dataset_path():
16491648
expected = {
1650-
"project": "octopus",
1651-
"location": "oyster",
1652-
"dataset": "nudibranch",
1649+
"project": "whelk",
1650+
"dataset": "octopus",
16531651
}
16541652
path = MigrationServiceClient.dataset_path(**expected)
16551653

@@ -1659,18 +1657,20 @@ def test_parse_dataset_path():
16591657

16601658

16611659
def test_dataset_path():
1662-
project = "cuttlefish"
1663-
dataset = "mussel"
1664-
expected = "projects/{project}/datasets/{dataset}".format(
1665-
project=project, dataset=dataset,
1660+
project = "oyster"
1661+
location = "nudibranch"
1662+
dataset = "cuttlefish"
1663+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
1664+
project=project, location=location, dataset=dataset,
16661665
)
1667-
actual = MigrationServiceClient.dataset_path(project, dataset)
1666+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
16681667
assert expected == actual
16691668

16701669

16711670
def test_parse_dataset_path():
16721671
expected = {
1673-
"project": "winkle",
1672+
"project": "mussel",
1673+
"location": "winkle",
16741674
"dataset": "nautilus",
16751675
}
16761676
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)