From a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 Mon Sep 17 00:00:00 2001 From: Googler Date: Thu, 14 Apr 2022 17:54:21 -0700 Subject: [PATCH] chore(components/google-cloud): Alias create_custom_training_job_op_from_component to create_custom_training_job_from_component PiperOrigin-RevId: 441899934 --- .../v1/custom_job/__init__.py | 7 +++++-- .../v1/custom_job/utils.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/__init__.py b/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/__init__.py index 6effe6a67e6..414043562ec 100644 --- a/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/__init__.py +++ b/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/__init__.py @@ -15,6 +15,10 @@ import os +from .utils import create_custom_training_job_op_from_component +# Aliasing for better readability +create_custom_training_job_from_component = create_custom_training_job_op_from_component + try: from kfp.v2.components import load_component_from_file except ImportError: @@ -23,9 +27,8 @@ __all__ = [ 'CustomTrainingJobOp', 'create_custom_training_job_op_from_component', + 'create_custom_training_job_from_component', ] - CustomTrainingJobOp = load_component_from_file( os.path.join(os.path.dirname(__file__), 'component.yaml')) - diff --git a/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/utils.py b/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/utils.py index 301d0f405c7..fc5b30b9522 100644 --- a/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/utils.py +++ b/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/utils.py @@ -32,6 +32,8 @@ _EXECUTOR_PLACE_HOLDER_REPLACEMENT = '{{$.json_escape[1]}}' +# This method is aliased to "create_custom_training_job_from_component" for +# better readability def create_custom_training_job_op_from_component( component_spec: Callable, # pylint: disable=g-bare-generic display_name: Optional[str] = '',