Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat(datalabeling): undeprecate resource name helper methods (via syn…
Browse files Browse the repository at this point in the history
…th) (#10039)
  • Loading branch information
yoshi-automation authored and busunkim96 committed Jan 8, 2020
1 parent 992ea8d commit 88f8090
Show file tree
Hide file tree
Showing 2 changed files with 3,523 additions and 59 deletions.
Expand Up @@ -90,12 +90,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def annotated_dataset_path(cls, project, dataset, annotated_dataset):
"""DEPRECATED. Return a fully-qualified annotated_dataset string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified annotated_dataset string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}",
project=project,
Expand All @@ -105,12 +100,7 @@ def annotated_dataset_path(cls, project, dataset, annotated_dataset):

@classmethod
def annotation_spec_set_path(cls, project, annotation_spec_set):
"""DEPRECATED. Return a fully-qualified annotation_spec_set string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified annotation_spec_set string."""
return google.api_core.path_template.expand(
"projects/{project}/annotationSpecSets/{annotation_spec_set}",
project=project,
Expand All @@ -119,12 +109,7 @@ def annotation_spec_set_path(cls, project, annotation_spec_set):

@classmethod
def data_item_path(cls, project, dataset, data_item):
"""DEPRECATED. Return a fully-qualified data_item string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified data_item string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/dataItems/{data_item}",
project=project,
Expand All @@ -134,24 +119,14 @@ def data_item_path(cls, project, dataset, data_item):

@classmethod
def dataset_path(cls, project, dataset):
"""DEPRECATED. Return a fully-qualified dataset string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified dataset string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}", project=project, dataset=dataset
)

@classmethod
def evaluation_path(cls, project, dataset, evaluation):
"""DEPRECATED. Return a fully-qualified evaluation string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified evaluation string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/evaluations/{evaluation}",
project=project,
Expand All @@ -161,12 +136,7 @@ def evaluation_path(cls, project, dataset, evaluation):

@classmethod
def evaluation_job_path(cls, project, evaluation_job):
"""DEPRECATED. Return a fully-qualified evaluation_job string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified evaluation_job string."""
return google.api_core.path_template.expand(
"projects/{project}/evaluationJobs/{evaluation_job}",
project=project,
Expand All @@ -175,12 +145,7 @@ def evaluation_job_path(cls, project, evaluation_job):

@classmethod
def example_path(cls, project, dataset, annotated_dataset, example):
"""DEPRECATED. Return a fully-qualified example string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified example string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}",
project=project,
Expand All @@ -191,12 +156,7 @@ def example_path(cls, project, dataset, annotated_dataset, example):

@classmethod
def instruction_path(cls, project, instruction):
"""DEPRECATED. Return a fully-qualified instruction string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified instruction string."""
return google.api_core.path_template.expand(
"projects/{project}/instructions/{instruction}",
project=project,
Expand All @@ -205,12 +165,7 @@ def instruction_path(cls, project, instruction):

@classmethod
def project_path(cls, project):
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)
Expand Down

0 comments on commit 88f8090

Please sign in to comment.