Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datalabeling): undeprecate resource name helper methods (via synth) #10039

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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