Skip to content

Commit 2aceba5

Browse files
chore: add .coveragerc in schema/predict/* (#475)
PiperOrigin-RevId: 378689078 Source-Link: googleapis/googleapis@c670b27 Source-Link: googleapis/googleapis-gen@ef5d0e9
1 parent 91c3419 commit 2aceba5

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
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
@@ -195,32 +195,32 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
195195
return m.groupdict() if m else {}
196196

197197
@staticmethod
198-
def dataset_path(project: str, location: str, dataset: str,) -> str:
198+
def dataset_path(project: str, dataset: str,) -> str:
199199
"""Returns a fully-qualified dataset string."""
200-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
201-
project=project, location=location, dataset=dataset,
200+
return "projects/{project}/datasets/{dataset}".format(
201+
project=project, dataset=dataset,
202202
)
203203

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

213210
@staticmethod
214-
def dataset_path(project: str, dataset: str,) -> str:
211+
def dataset_path(project: str, location: str, dataset: str,) -> str:
215212
"""Returns a fully-qualified dataset string."""
216-
return "projects/{project}/datasets/{dataset}".format(
217-
project=project, dataset=dataset,
213+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
214+
project=project, location=location, dataset=dataset,
218215
)
219216

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

226226
@staticmethod

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

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

197197
@staticmethod
198-
def dataset_path(project: str, dataset: str,) -> str:
198+
def dataset_path(project: str, location: str, dataset: str,) -> str:
199199
"""Returns a fully-qualified dataset string."""
200-
return "projects/{project}/datasets/{dataset}".format(
201-
project=project, dataset=dataset,
200+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
201+
project=project, location=location, dataset=dataset,
202202
)
203203

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

210213
@staticmethod
211-
def dataset_path(project: str, location: str, dataset: str,) -> str:
214+
def dataset_path(project: str, dataset: str,) -> str:
212215
"""Returns a fully-qualified dataset string."""
213-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
214-
project=project, location=location, dataset=dataset,
216+
return "projects/{project}/datasets/{dataset}".format(
217+
project=project, dataset=dataset,
215218
)
216219

217220
@staticmethod
218221
def parse_dataset_path(path: str) -> Dict[str, str]:
219222
"""Parses a dataset path into its component segments."""
220-
m = re.match(
221-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
222-
path,
223-
)
223+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
224224
return m.groupdict() if m else {}
225225

226226
@staticmethod

tests/unit/gapic/aiplatform_v1/test_migration_service.py

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

17571757
def test_dataset_path():
17581758
project = "squid"
1759-
location = "clam"
1760-
dataset = "whelk"
1761-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
1762-
project=project, location=location, dataset=dataset,
1759+
dataset = "clam"
1760+
expected = "projects/{project}/datasets/{dataset}".format(
1761+
project=project, dataset=dataset,
17631762
)
1764-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
1763+
actual = MigrationServiceClient.dataset_path(project, dataset)
17651764
assert expected == actual
17661765

17671766

17681767
def test_parse_dataset_path():
17691768
expected = {
1770-
"project": "octopus",
1771-
"location": "oyster",
1772-
"dataset": "nudibranch",
1769+
"project": "whelk",
1770+
"dataset": "octopus",
17731771
}
17741772
path = MigrationServiceClient.dataset_path(**expected)
17751773

@@ -1779,18 +1777,20 @@ def test_parse_dataset_path():
17791777

17801778

17811779
def test_dataset_path():
1782-
project = "cuttlefish"
1783-
dataset = "mussel"
1784-
expected = "projects/{project}/datasets/{dataset}".format(
1785-
project=project, dataset=dataset,
1780+
project = "oyster"
1781+
location = "nudibranch"
1782+
dataset = "cuttlefish"
1783+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
1784+
project=project, location=location, dataset=dataset,
17861785
)
1787-
actual = MigrationServiceClient.dataset_path(project, dataset)
1786+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
17881787
assert expected == actual
17891788

17901789

17911790
def test_parse_dataset_path():
17921791
expected = {
1793-
"project": "winkle",
1792+
"project": "mussel",
1793+
"location": "winkle",
17941794
"dataset": "nautilus",
17951795
}
17961796
path = MigrationServiceClient.dataset_path(**expected)

tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py

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

17591759
def test_dataset_path():
17601760
project = "squid"
1761-
dataset = "clam"
1762-
expected = "projects/{project}/datasets/{dataset}".format(
1763-
project=project, dataset=dataset,
1761+
location = "clam"
1762+
dataset = "whelk"
1763+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
1764+
project=project, location=location, dataset=dataset,
17641765
)
1765-
actual = MigrationServiceClient.dataset_path(project, dataset)
1766+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
17661767
assert expected == actual
17671768

17681769

17691770
def test_parse_dataset_path():
17701771
expected = {
1771-
"project": "whelk",
1772-
"dataset": "octopus",
1772+
"project": "octopus",
1773+
"location": "oyster",
1774+
"dataset": "nudibranch",
17731775
}
17741776
path = MigrationServiceClient.dataset_path(**expected)
17751777

@@ -1779,20 +1781,18 @@ def test_parse_dataset_path():
17791781

17801782

17811783
def test_dataset_path():
1782-
project = "oyster"
1783-
location = "nudibranch"
1784-
dataset = "cuttlefish"
1785-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
1786-
project=project, location=location, dataset=dataset,
1784+
project = "cuttlefish"
1785+
dataset = "mussel"
1786+
expected = "projects/{project}/datasets/{dataset}".format(
1787+
project=project, dataset=dataset,
17871788
)
1788-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
1789+
actual = MigrationServiceClient.dataset_path(project, dataset)
17891790
assert expected == actual
17901791

17911792

17921793
def test_parse_dataset_path():
17931794
expected = {
1794-
"project": "mussel",
1795-
"location": "winkle",
1795+
"project": "winkle",
17961796
"dataset": "nautilus",
17971797
}
17981798
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)