Skip to content

Commit 2ffab7a

Browse files
author
svia3
committed
fix: add warning message for job-prefixed pipeline steps when no job name is provided
1 parent d083396 commit 2ffab7a

File tree

2 files changed

+207
-173
lines changed

2 files changed

+207
-173
lines changed

src/sagemaker/workflow/utilities.py

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
"if desired."
4242
)
4343

44+
# pylint: disable=C0301
45+
JOB_KEY_NONE_WARN_MSG_TEMPLATE = (
46+
"Invalid input: the use_custom_job_prefix is set but the name field [{}] has not been specified. "
47+
"Please refer to the AWS Docs to identify which field should be set to enable the "
48+
"custom-prefixing feature for jobs created via a pipeline execution. "
49+
"https://docs.aws.amazon.com/sagemaker/latest/dg/build-and-manage-access.html#build-and-manage-step-permissions-prefix"
50+
)
51+
4452
if TYPE_CHECKING:
4553
from sagemaker.workflow.step_collections import StepCollection
4654

@@ -458,6 +466,8 @@ def trim_request_dict(request_dict, job_key, config):
458466
request_dict.pop(job_key, None) # safely return null in case of KeyError
459467
else:
460468
if job_key in request_dict:
469+
if request_dict[job_key] is None:
470+
raise ValueError(JOB_KEY_NONE_WARN_MSG_TEMPLATE.format(job_key))
461471
request_dict[job_key] = base_from_name(request_dict[job_key]) # trim timestamp
462472

463473
return request_dict

0 commit comments

Comments
 (0)