@@ -1436,6 +1436,8 @@ def test_normalize_outputs_with_none_s3_uri_generates_s3_path(self, mock_session
14361436
14371437 def test_normalize_outputs_with_none_s3_uri_and_pipeline_config (self , mock_session ):
14381438 """When s3_uri is None and pipeline_config is set, use pipeline-based path."""
1439+ from sagemaker .core .workflow .functions import Join
1440+
14391441 processor = Processor (
14401442 role = "arn:aws:iam::123456789012:role/SageMakerRole" ,
14411443 image_uri = "test-image:latest" ,
@@ -1459,7 +1461,11 @@ def test_normalize_outputs_with_none_s3_uri_and_pipeline_config(self, mock_sessi
14591461
14601462 assert len (result ) == 1
14611463 # The result should be a Join object (pipeline variable) when pipeline_config is set
1462- assert result [0 ].s3_output .s3_uri is not None
1464+ assert isinstance (result [0 ].s3_output .s3_uri , Join )
1465+ # Verify the Join contains expected pipeline-related values
1466+ join_obj = result [0 ].s3_output .s3_uri
1467+ assert join_obj .on == "/"
1468+ assert "test-pipeline" in join_obj .values
14631469
14641470 def test_normalize_outputs_with_none_s3_uri_auto_generates_name (self , mock_session ):
14651471 """When output_name is None and s3_uri is None, both should be auto-generated."""
@@ -1488,6 +1494,29 @@ def test_normalize_outputs_with_none_s3_uri_auto_generates_name(self, mock_sessi
14881494 assert generated_uri .startswith ("s3://" )
14891495 assert "output-1" in generated_uri
14901496
1497+ def test_normalize_outputs_with_no_s3_output_at_all (self , mock_session ):
1498+ """When s3_output is None entirely, a new ProcessingS3Output is created."""
1499+ processor = Processor (
1500+ role = "arn:aws:iam::123456789012:role/SageMakerRole" ,
1501+ image_uri = "test-image:latest" ,
1502+ instance_count = 1 ,
1503+ instance_type = "ml.m5.xlarge" ,
1504+ sagemaker_session = mock_session ,
1505+ )
1506+ processor ._current_job_name = "test-job"
1507+
1508+ outputs = [ProcessingOutput (output_name = "my-output" )]
1509+
1510+ with patch ("sagemaker.core.workflow.utilities._pipeline_config" , None ):
1511+ result = processor ._normalize_outputs (outputs )
1512+
1513+ assert len (result ) == 1
1514+ assert result [0 ].s3_output is not None
1515+ assert result [0 ].s3_output .s3_uri .startswith ("s3://" )
1516+ assert result [0 ].s3_output .local_path == "/opt/ml/processing/output"
1517+ assert result [0 ].s3_output .s3_upload_mode == "EndOfJob"
1518+ assert "my-output" in result [0 ].s3_output .s3_uri
1519+
14911520 def test_processing_output_to_request_dict_omits_s3_uri_when_none (self ):
14921521 """Verify _processing_output_to_request_dict omits S3Uri when s3_uri is None."""
14931522 s3_output = ProcessingS3Output (
0 commit comments