Skip to content

Commit 117248a

Browse files
author
Googler
committed
chore(components): Add check that component in preview.custom_job.utils.create_custom_training_job_from_component doesn't have any parameters that share names with any custom job fields
Signed-off-by: Googler <nobody@google.com> PiperOrigin-RevId: 655491300
1 parent 7660e8a commit 117248a

File tree

2 files changed

+18
-0
lines changed
  • components/google-cloud

2 files changed

+18
-0
lines changed

components/google-cloud/RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Fix bug in Starry Net's upload decomposition plot step due to protobuf upgrade, by pinning protobuf library to 3.20.*.
44
* Add support for running tasks on a `PersistentResource` (see [CustomJobSpec](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/CustomJobSpec)) via `persistent_resource_id` parameter on `v1.custom_job.CustomTrainingJobOp` and `v1.custom_job.create_custom_training_job_from_component`
55
* Bump image for Structured Data pipelines.
6+
* Add check that component in preview.custom_job.utils.create_custom_training_job_from_component doesn't have any parameters that share names with any custom job fields
67

78
## Release 2.15.0
89
* Add Gemini batch prediction support to `v1.model_evaluation.autosxs_pipeline`.

components/google-cloud/google_cloud_pipeline_components/preview/custom_job/utils.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,23 @@ def create_custom_training_job_from_component(
210210
'defaultValue'
211211
] = default_value
212212

213+
# check if user component has any input parameters that already exist in the
214+
# custom job component
215+
for param_name in user_component_spec.get('inputDefinitions', {}).get(
216+
'parameters', {}
217+
):
218+
if param_name in cj_component_spec['inputDefinitions']['parameters']:
219+
raise ValueError(
220+
f'Input parameter {param_name} already exists in the CustomJob component.' # pylint: disable=line-too-long
221+
)
222+
for param_name in user_component_spec.get('outputDefinitions', {}).get(
223+
'parameters', {}
224+
):
225+
if param_name in cj_component_spec['outputDefinitions']['parameters']:
226+
raise ValueError(
227+
f'Output parameter {param_name} already exists in the CustomJob component.' # pylint: disable=line-too-long
228+
)
229+
213230
# merge parameters from user component into the customjob component
214231
cj_component_spec['inputDefinitions']['parameters'].update(
215232
user_component_spec.get('inputDefinitions', {}).get('parameters', {})

0 commit comments

Comments
 (0)