diff --git a/components/google-cloud/RELEASE.md b/components/google-cloud/RELEASE.md index 3e1c72cb3e16..b52cc63803b9 100644 --- a/components/google-cloud/RELEASE.md +++ b/components/google-cloud/RELEASE.md @@ -1,6 +1,7 @@ ## Upcoming release * Remove default prediction column names in `v1.model_evaluation.regression_component` component to fix pipeline errors when using bigquery data source. * Add reservation_affinition support in `v1.create_custom_training_job_from_component`. +* Deprecate `preview.custom_job.create_custom_training_job_from_component` and `preview.custom_job.CustomTrainingJobOP`. ## Release 2.17.0 * Fix Gemini batch prediction support to `v1.model_evaluation.autosxs_pipeline` after output schema change. diff --git a/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/component.py b/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/component.py index 585c9423e9cf..d64ce70d1619 100644 --- a/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/component.py +++ b/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/component.py @@ -13,6 +13,7 @@ # limitations under the License. from typing import Dict, List +import warnings from google_cloud_pipeline_components import _image from google_cloud_pipeline_components import _placeholders @@ -63,6 +64,13 @@ def custom_training_job( gcp_resources: Serialized JSON of `gcp_resources` [proto](https://github.com/kubeflow/pipelines/tree/master/components/google-cloud/google_cloud_pipeline_components/proto) which tracks the CustomJob. """ # fmt: on + warnings.warn( + "'preview.custom_job.CustomTrainingJobOp' is" + ' deprecated and will be removed in a future release. Please use' + "'v1.custom_job.CustomTrainingJobOp' instead.", + DeprecationWarning, + ) + return dsl.ContainerSpec( image=_image.GCPC_IMAGE_TAG, command=[ diff --git a/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/utils.py b/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/utils.py index ec5bdaa78263..e2697fad0a7b 100644 --- a/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/utils.py +++ b/components/google-cloud/google_cloud_pipeline_components/preview/custom_job/utils.py @@ -138,6 +138,13 @@ def create_custom_training_job_from_component( # After adding the appropriate description and the name, the new component # is returned. + warnings.warn( + "'preview.custom_job.create_custom_training_job_from_component' is" + ' deprecated and will be removed in a future release. Please use' + " 'v1.custom_job.create_custom_training_job_from_component' instead.", + DeprecationWarning, + ) + cj_pipeline_spec = json_format.MessageToDict( component.custom_training_job.pipeline_spec )