Skip to content

Commit b3842a8

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- ae23895 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: fix!: fix issue when using UrlContext tool PiperOrigin-RevId: 840347639 Source-Link: googleapis/googleapis@a448b7d Source-Link: googleapis/googleapis-gen@0a0fb28 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGEwZmIyOGFlMWU2YjU3NGQyNTM0NTk3MDI0MjcwMjMzMTIxNGEzNSJ9 -- 424baee 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=#6182 from googleapis:owl-bot-copy 424baee PiperOrigin-RevId: 842481218
1 parent da79e21 commit b3842a8

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,40 +243,40 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]:
243243
@staticmethod
244244
def dataset_path(
245245
project: str,
246-
location: str,
247246
dataset: str,
248247
) -> str:
249248
"""Returns a fully-qualified dataset string."""
250-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
249+
return "projects/{project}/datasets/{dataset}".format(
251250
project=project,
252-
location=location,
253251
dataset=dataset,
254252
)
255253

256254
@staticmethod
257255
def parse_dataset_path(path: str) -> Dict[str, str]:
258256
"""Parses a dataset path into its component segments."""
259-
m = re.match(
260-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
261-
path,
262-
)
257+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
263258
return m.groupdict() if m else {}
264259

265260
@staticmethod
266261
def dataset_path(
267262
project: str,
263+
location: str,
268264
dataset: str,
269265
) -> str:
270266
"""Returns a fully-qualified dataset string."""
271-
return "projects/{project}/datasets/{dataset}".format(
267+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
272268
project=project,
269+
location=location,
273270
dataset=dataset,
274271
)
275272

276273
@staticmethod
277274
def parse_dataset_path(path: str) -> Dict[str, str]:
278275
"""Parses a dataset path into its component segments."""
279-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
276+
m = re.match(
277+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
278+
path,
279+
)
280280
return m.groupdict() if m else {}
281281

282282
@staticmethod

google/cloud/aiplatform_v1/types/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class Environment(proto.Enum):
265265
)
266266
url_context: "UrlContext" = proto.Field(
267267
proto.MESSAGE,
268-
number=8,
268+
number=10,
269269
message="UrlContext",
270270
)
271271
computer_use: ComputerUse = proto.Field(

google/cloud/aiplatform_v1beta1/types/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class Environment(proto.Enum):
266266
)
267267
url_context: "UrlContext" = proto.Field(
268268
proto.MESSAGE,
269-
number=8,
269+
number=10,
270270
message="UrlContext",
271271
)
272272
computer_use: ComputerUse = proto.Field(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.129.0"
11+
"version": "0.0.0"
1212
},
1313
"snippets": [
1414
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.129.0"
11+
"version": "0.0.0"
1212
},
1313
"snippets": [
1414
{

tests/unit/gapic/aiplatform_v1/test_migration_service.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5401,22 +5401,19 @@ def test_parse_annotated_dataset_path():
54015401

54025402
def test_dataset_path():
54035403
project = "cuttlefish"
5404-
location = "mussel"
5405-
dataset = "winkle"
5406-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
5404+
dataset = "mussel"
5405+
expected = "projects/{project}/datasets/{dataset}".format(
54075406
project=project,
5408-
location=location,
54095407
dataset=dataset,
54105408
)
5411-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
5409+
actual = MigrationServiceClient.dataset_path(project, dataset)
54125410
assert expected == actual
54135411

54145412

54155413
def test_parse_dataset_path():
54165414
expected = {
5417-
"project": "nautilus",
5418-
"location": "scallop",
5419-
"dataset": "abalone",
5415+
"project": "winkle",
5416+
"dataset": "nautilus",
54205417
}
54215418
path = MigrationServiceClient.dataset_path(**expected)
54225419

@@ -5426,19 +5423,22 @@ def test_parse_dataset_path():
54265423

54275424

54285425
def test_dataset_path():
5429-
project = "squid"
5430-
dataset = "clam"
5431-
expected = "projects/{project}/datasets/{dataset}".format(
5426+
project = "scallop"
5427+
location = "abalone"
5428+
dataset = "squid"
5429+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
54325430
project=project,
5431+
location=location,
54335432
dataset=dataset,
54345433
)
5435-
actual = MigrationServiceClient.dataset_path(project, dataset)
5434+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
54365435
assert expected == actual
54375436

54385437

54395438
def test_parse_dataset_path():
54405439
expected = {
5441-
"project": "whelk",
5440+
"project": "clam",
5441+
"location": "whelk",
54425442
"dataset": "octopus",
54435443
}
54445444
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)