sagemaker-python-sdk
sagemaker-python-sdk copied to clipboard
Reduce risks of errors due to `CreateProcessingJob` supporting only strings
When trying to reference a pipeline parameter of type ParameterInteger when creating a pipeline job, I get the following error:
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the CreatePipeline operation: Cannot assign property reference [Parameters.split_number] to argument of type [String].
I saw that it wasn't supported and that it's not expected to change (https://github.com/aws/sagemaker-python-sdk/issues/2631). Since it could prevent people — like me — from searching what they did wrong when it's just not supported, I think it should be better documented.
I see two ways to improve the documentation:
- Change the type hints of
argumentsfor the steps.
From:
arguments: Optional[List[Union[str, PipelineVariable]]] = None
to
arguments: Optional[List[Union[str, ParameterString]]] = None
- Add comments explaining that
CreateProcessingJobAPI only supports strings, so any other type ofPipelineVariableshould be converted.