Skip to content

Commit

Permalink
fix!: remove large_model_reference from Model in aiplatform v1beta1 m…
Browse files Browse the repository at this point in the history
…odel.proto

PiperOrigin-RevId: 517426269

Source-Link: googleapis/googleapis@8c36220

Source-Link: googleapis/googleapis-gen@4e60cf5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGU2MGNmNWMxN2U1YWVmMDk3Y2FlZWI2MGY2NjQyNGUyNWU5MzFiNyJ9
  • Loading branch information
gcf-owl-bot[bot] committed Mar 17, 2023
1 parent 9a3775f commit 07037cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,25 @@ def parse_annotated_dataset_path(path: str) -> Dict[str,str]:
return m.groupdict() if m else {}

@staticmethod
def dataset_path(project: str,dataset: str,) -> str:
def dataset_path(project: str,location: str,dataset: str,) -> str:
"""Returns a fully-qualified dataset string."""
return "projects/{project}/datasets/{dataset}".format(project=project, dataset=dataset, )
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
def dataset_path(project: str,location: str,dataset: str,) -> str:
def dataset_path(project: str,dataset: str,) -> str:
"""Returns a fully-qualified dataset string."""
return "projects/{project}/locations/{location}/datasets/{dataset}".format(project=project, location=location, dataset=dataset, )
return "projects/{project}/datasets/{dataset}".format(project=project, 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,6 @@ class Model(proto.Message):
created in MetadataStore when creating the Model. The
Artifact resource name pattern is
``projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}``.
large_model_reference (google.cloud.aiplatform_v1beta1.types.Model.LargeModelReference):
Optional. Used to specify the large model
reference. Only present for Large Models.
"""
class DeploymentResourcesType(proto.Enum):
r"""Identifies a type of Model's prediction resources.
Expand Down Expand Up @@ -406,21 +403,6 @@ class OriginalModelInfo(proto.Message):
number=1,
)

class LargeModelReference(proto.Message):
r"""Contains information about the Large Model.
Attributes:
name (str):
Required. The unique name of the large
Foundation or pre-built model. Like
"chat-panda", "text-panda".
"""

name: str = proto.Field(
proto.STRING,
number=1,
)

name: str = proto.Field(
proto.STRING,
number=1,
Expand Down Expand Up @@ -548,11 +530,6 @@ class LargeModelReference(proto.Message):
proto.STRING,
number=44,
)
large_model_reference: LargeModelReference = proto.Field(
proto.MESSAGE,
number=45,
message=LargeModelReference,
)


class PredictSchemata(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1704,16 +1704,18 @@ def test_parse_annotated_dataset_path():

def test_dataset_path():
project = "cuttlefish"
dataset = "mussel"
expected = "projects/{project}/datasets/{dataset}".format(project=project, dataset=dataset, )
actual = MigrationServiceClient.dataset_path(project, dataset)
location = "mussel"
dataset = "winkle"
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(project=project, location=location, dataset=dataset, )
actual = MigrationServiceClient.dataset_path(project, location, dataset)
assert expected == actual


def test_parse_dataset_path():
expected = {
"project": "winkle",
"dataset": "nautilus",
"project": "nautilus",
"location": "scallop",
"dataset": "abalone",
}
path = MigrationServiceClient.dataset_path(**expected)

Expand All @@ -1722,18 +1724,16 @@ def test_parse_dataset_path():
assert expected == actual

def test_dataset_path():
project = "scallop"
location = "abalone"
dataset = "squid"
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(project=project, location=location, dataset=dataset, )
actual = MigrationServiceClient.dataset_path(project, location, dataset)
project = "squid"
dataset = "clam"
expected = "projects/{project}/datasets/{dataset}".format(project=project, dataset=dataset, )
actual = MigrationServiceClient.dataset_path(project, dataset)
assert expected == actual


def test_parse_dataset_path():
expected = {
"project": "clam",
"location": "whelk",
"project": "whelk",
"dataset": "octopus",
}
path = MigrationServiceClient.dataset_path(**expected)
Expand Down

0 comments on commit 07037cc

Please sign in to comment.