@@ -732,16 +732,10 @@ def test_processing_job_inputs_and_output_config(
732
732
)
733
733
734
734
job_description = script_processor .latest_job .describe ()
735
- expected_inputs_and_outputs = _get_processing_job_inputs_and_outputs ()
736
- print ("###" )
737
- print (job_description ["ProcessingInputs" ][:- 1 ])
738
- print (expected_inputs_and_outputs ["ProcessingInputs" ])
735
+ expected_inputs_and_outputs = _get_processing_job_inputs_and_outputs (sagemaker_session .default_bucket (), output_kms_key )
739
736
assert (
740
737
job_description ["ProcessingInputs" ][:- 1 ] == expected_inputs_and_outputs ["ProcessingInputs" ]
741
738
)
742
- print ("###" )
743
- print (job_description ["ProcessingOutputConfig" ])
744
- print (expected_inputs_and_outputs ["ProcessingOutputConfig" ])
745
739
assert (
746
740
job_description ["ProcessingOutputConfig" ]
747
741
== expected_inputs_and_outputs ["ProcessingOutputConfig" ]
@@ -815,14 +809,14 @@ def _get_processing_outputs_with_all_parameters():
815
809
]
816
810
817
811
818
- def _get_processing_job_inputs_and_outputs ():
812
+ def _get_processing_job_inputs_and_outputs (bucket , output_kms_key ):
819
813
return {
820
814
"ProcessingInputs" : [
821
815
{
822
816
"InputName" : "my_dataset" ,
823
817
"AppManaged" : False ,
824
818
"S3Input" : {
825
- "S3Uri" : "s3://sagemaker-us-west-2-790336243319 " ,
819
+ "S3Uri" : f "s3://{ bucket } " ,
826
820
"LocalPath" : "/opt/ml/processing/input/data/" ,
827
821
"S3DataType" : "S3Prefix" ,
828
822
"S3InputMode" : "File" ,
@@ -834,7 +828,7 @@ def _get_processing_job_inputs_and_outputs():
834
828
"InputName" : "s3_input" ,
835
829
"AppManaged" : False ,
836
830
"S3Input" : {
837
- "S3Uri" : "s3://sagemaker-us-west-2-790336243319 " ,
831
+ "S3Uri" : f "s3://{ bucket } " ,
838
832
"LocalPath" : "/opt/ml/processing/input/s3_input" ,
839
833
"S3DataType" : "S3Prefix" ,
840
834
"S3InputMode" : "File" ,
@@ -852,7 +846,7 @@ def _get_processing_job_inputs_and_outputs():
852
846
"DbUser" : "awsuser" ,
853
847
"QueryString" : "SELECT * FROM shoes" ,
854
848
"ClusterRoleArn" : "arn:aws:iam::037210630505:role/RedshiftClusterRole-prod-us-west-2" ,
855
- "OutputS3Uri" : "s3://sagemaker-us-west-2-790336243319 /rdd" ,
849
+ "OutputS3Uri" : f "s3://{ bucket } /rdd" ,
856
850
"OutputFormat" : "CSV" ,
857
851
"OutputCompression" : "None" ,
858
852
},
@@ -870,7 +864,7 @@ def _get_processing_job_inputs_and_outputs():
870
864
"Database" : "default" ,
871
865
"QueryString" : 'SELECT * FROM "default"."s3_test_table_$STAGE_$REGIONUNDERSCORED";' ,
872
866
"WorkGroup" : "workgroup" ,
873
- "OutputS3Uri" : "s3://sagemaker-us-west-2-790336243319 /add" ,
867
+ "OutputS3Uri" : f "s3://{ bucket } /add" ,
874
868
"OutputFormat" : "JSON" ,
875
869
"OutputCompression" : "GZIP" ,
876
870
},
@@ -888,6 +882,6 @@ def _get_processing_job_inputs_and_outputs():
888
882
"AppManaged" : True ,
889
883
}
890
884
],
891
- "KmsKeyId" : "arn:aws:kms:us-west-2:790336243319:key/e4d2e5b5-346f-42cf-a8a7-60f18054893c" ,
885
+ "KmsKeyId" : output_kms_key ,
892
886
},
893
887
}
0 commit comments