code: def test_pipeline_interpolates_lambda_outputs(sagemaker_session):
      custom_step = CustomStep("TestStep")
      parameter = ParameterString("MyStr")
      output_param1 = LambdaOutput(
          output_name="output1", output_type=LambdaOutputTypeEnum.String
      )
      output_param2 = LambdaOutput(
          output_name="output2", output_type=LambdaOutputTypeEnum.String
      )
      lambda_step1 = LambdaStep(
          name="MyLambdaStep1",
          depends_on=[custom_step],
          lambda_func=Lambda(
              function_arn="arn:aws:lambda:us-west-2:123456789012:function:sagemaker_test_lambda",
              session=sagemaker_session,
          ),
          inputs={"arg1": "foo"},
          outputs=[output_param1],
      )
      lambda_step2 = LambdaStep(
          name="MyLambdaStep2",
          depends_on=[custom_step],
          lambda_func=Lambda(
              function_arn="arn:aws:lambda:us-west-2:123456789012:function:sagemaker_test_lambda",
              session=sagemaker_session,
          ),
          inputs={"arg1": output_param1},
          outputs=[output_param2],
      )
  
      pipeline = Pipeline(
          name="MyPipeline",
          parameters=[parameter],
          steps=[lambda_step1, lambda_step2, custom_step],
          sagemaker_session=sagemaker_session,
      )
  
      assert json.loads(pipeline.definition()) == {
          "Version": "2020-12-01",
          "Metadata": {},
          "Parameters": [{"Name": "MyStr", "Type": "String"}],
          "PipelineExperimentConfig": {
              "ExperimentName": {"Get": "Execution.PipelineName"},
              "TrialName": {"Get": "Execution.PipelineExecutionId"},
          },
          "Steps": [
              {
                  "Name": "MyLambdaStep1",
                  "Type": "Lambda",
                  "Arguments": {"arg1": "foo"},
                  "DependsOn": ["TestStep"],
                  "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:sagemaker_test_lambda",
                  "OutputParameters": [
                      {"OutputName": "output1", "OutputType": "String"}
                  ],
              },
              {
                  "Name": "MyLambdaStep2",
                  "Type": "Lambda",
                  "Arguments": {
                      "arg1": {
                          "Get": "Steps.MyLambdaStep1.OutputParameters['output1']"
                      }
                  },
                  "DependsOn": ["TestStep"],
                  "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:sagemaker_test_lambda",
                  "OutputParameters": [
                      {"OutputName": "output2", "OutputType": "String"}
                  ],
              },
              {
                  "Name": "TestStep",
                  "Type": "Training",
                  "Arguments": {},
              },
          ],
      }
      adjacency_list = PipelineGraph.from_pipeline(
          pipeline
      ).adjacency_list
      assert ordered(adjacency_list) == ordered(
          {
              "MyLambdaStep1": [],
              "MyLambdaStep2": [],
              "TestStep": ["MyLambdaStep1", "MyLambdaStep2"],
          }
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_lambda_step.py
imports: from __future__ import absolute_import
  import json
  import pytest
  from mock import Mock, MagicMock
  from sagemaker.workflow.parameters import ParameterInteger, ParameterString
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.lambda_step import LambdaStep, LambdaOutput, LambdaOutputTypeEnum
  from sagemaker.lambda_helper import Lambda
  from sagemaker.workflow.steps import CacheConfig
  from tests.unit.sagemaker.workflow.helpers import CustomStep, ordered
label_desc: Use image node_id 4 for calling a global function with example usage: test_pipeline_interpolates_lambda_outputs(sagemaker_session) without return types