Skip to content

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 3093f3c commit 3d00a9c
Show file tree
Hide file tree
Showing 2 changed files with 3,523 additions and 59 deletions.
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 3d00a9c

Please sign in to comment.