Skip to content

Commit b03e0e6

Browse files
chore: use gapic generator python 1.4.1 (googleapis#1655)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 473833416 Source-Link: googleapis/googleapis@565a550 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ee1a06c6de3ca8b843572c1fde0548f84236989 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWVlMWEwNmM2ZGUzY2E4Yjg0MzU3MmMxZmRlMDU0OGY4NDIzNjk4OSJ9
1 parent fe9b369 commit b03e0e6

32 files changed

Lines changed: 53 additions & 53 deletions

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,40 +196,40 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]:
196196
@staticmethod
197197
def dataset_path(
198198
project: str,
199+
location: str,
199200
dataset: str,
200201
) -> str:
201202
"""Returns a fully-qualified dataset string."""
202-
return "projects/{project}/datasets/{dataset}".format(
203+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
203204
project=project,
205+
location=location,
204206
dataset=dataset,
205207
)
206208

207209
@staticmethod
208210
def parse_dataset_path(path: str) -> Dict[str, str]:
209211
"""Parses a dataset path into its component segments."""
210-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
212+
m = re.match(
213+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
214+
path,
215+
)
211216
return m.groupdict() if m else {}
212217

213218
@staticmethod
214219
def dataset_path(
215220
project: str,
216-
location: str,
217221
dataset: str,
218222
) -> str:
219223
"""Returns a fully-qualified dataset string."""
220-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
224+
return "projects/{project}/datasets/{dataset}".format(
221225
project=project,
222-
location=location,
223226
dataset=dataset,
224227
)
225228

226229
@staticmethod
227230
def parse_dataset_path(path: str) -> Dict[str, str]:
228231
"""Parses a dataset path into its component segments."""
229-
m = re.match(
230-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
231-
path,
232-
)
232+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
233233
return m.groupdict() if m else {}
234234

235235
@staticmethod

tests/unit/gapic/aiplatform_v1/test_dataset_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_endpoint_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_featurestore_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_index_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_job_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_metadata_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions

tests/unit/gapic/aiplatform_v1/test_migration_service.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import math
2828
import pytest
2929
from proto.marshal.rules.dates import DurationRule, TimestampRule
30-
30+
from proto.marshal.rules import wrappers
3131

3232
from google.api_core import client_options
3333
from google.api_core import exceptions as core_exceptions
@@ -2004,19 +2004,22 @@ def test_parse_annotated_dataset_path():
20042004

20052005
def test_dataset_path():
20062006
project = "cuttlefish"
2007-
dataset = "mussel"
2008-
expected = "projects/{project}/datasets/{dataset}".format(
2007+
location = "mussel"
2008+
dataset = "winkle"
2009+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
20092010
project=project,
2011+
location=location,
20102012
dataset=dataset,
20112013
)
2012-
actual = MigrationServiceClient.dataset_path(project, dataset)
2014+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
20132015
assert expected == actual
20142016

20152017

20162018
def test_parse_dataset_path():
20172019
expected = {
2018-
"project": "winkle",
2019-
"dataset": "nautilus",
2020+
"project": "nautilus",
2021+
"location": "scallop",
2022+
"dataset": "abalone",
20202023
}
20212024
path = MigrationServiceClient.dataset_path(**expected)
20222025

@@ -2026,22 +2029,19 @@ def test_parse_dataset_path():
20262029

20272030

20282031
def test_dataset_path():
2029-
project = "scallop"
2030-
location = "abalone"
2031-
dataset = "squid"
2032-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
2032+
project = "squid"
2033+
dataset = "clam"
2034+
expected = "projects/{project}/datasets/{dataset}".format(
20332035
project=project,
2034-
location=location,
20352036
dataset=dataset,
20362037
)
2037-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
2038+
actual = MigrationServiceClient.dataset_path(project, dataset)
20382039
assert expected == actual
20392040

20402041

20412042
def test_parse_dataset_path():
20422043
expected = {
2043-
"project": "clam",
2044-
"location": "whelk",
2044+
"project": "whelk",
20452045
"dataset": "octopus",
20462046
}
20472047
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)