@@ -666,6 +666,44 @@ def test_processing_step_normalizes_args_with_local_code(mock_normalize_args, sc
666
666
)
667
667
668
668
669
+ def test_processing_step_normalizes_args_with_param_str_local_code (
670
+ sagemaker_session , script_processor
671
+ ):
672
+ cache_config = CacheConfig (enable_caching = True , expire_after = "PT1H" )
673
+ code_param = ParameterString (name = "Script" , default_value = "S3://my-bucket/file_name.py" )
674
+ inputs = [
675
+ ProcessingInput (
676
+ source = f"s3://{ BUCKET } /processing_manifest" ,
677
+ destination = "processing_manifest" ,
678
+ )
679
+ ]
680
+ outputs = [
681
+ ProcessingOutput (
682
+ source = f"s3://{ BUCKET } /processing_manifest" ,
683
+ destination = "processing_manifest" ,
684
+ )
685
+ ]
686
+ step = ProcessingStep (
687
+ name = "MyProcessingStep" ,
688
+ processor = script_processor ,
689
+ code = code_param ,
690
+ inputs = inputs ,
691
+ outputs = outputs ,
692
+ job_arguments = ["arg1" , "arg2" ],
693
+ cache_config = cache_config ,
694
+ )
695
+ pipeline = Pipeline (
696
+ name = "MyPipeline" ,
697
+ parameters = [code_param ],
698
+ steps = [step ],
699
+ sagemaker_session = sagemaker_session ,
700
+ )
701
+ with pytest .raises (ValueError ) as error :
702
+ pipeline .definition ()
703
+
704
+ assert "has to be a valid S3 URI or local file path" in str (error .value )
705
+
706
+
669
707
@patch ("sagemaker.processing.ScriptProcessor._normalize_args" )
670
708
def test_processing_step_normalizes_args_with_s3_code (mock_normalize_args , script_processor ):
671
709
cache_config = CacheConfig (enable_caching = True , expire_after = "PT1H" )
0 commit comments