code: def test_lambda_step(sagemaker_session):
      custom_step1 = CustomStep("TestStep")
      custom_step2 = CustomStep("SecondTestStep")
      param = ParameterInteger(name="MyInt")
      output_param1 = LambdaOutput(
          output_name="output1", output_type=LambdaOutputTypeEnum.String
      )
      output_param2 = LambdaOutput(
          output_name="output2",
          output_type=LambdaOutputTypeEnum.Boolean,
      )
      cache_config = CacheConfig(
          enable_caching=True, expire_after="PT1H"
      )
      lambda_step = LambdaStep(
          name="MyLambdaStep",
          depends_on=[custom_step1],
          lambda_func=Lambda(
              function_arn="arn:aws:lambda:us-west-2:123456789012:function:sagemaker_test_lambda",
              session=sagemaker_session,
          ),
          display_name="MyLambdaStep",
          description="MyLambdaStepDescription",
          inputs={"arg1": "foo", "arg2": 5, "arg3": param},
          outputs=[output_param1, output_param2],
          cache_config=cache_config,
      )
      lambda_step.add_depends_on([custom_step2])
      pipeline = Pipeline(
          name="MyPipeline",
          parameters=[param],
          steps=[lambda_step, custom_step1, custom_step2],
          sagemaker_session=sagemaker_session,
      )
      assert json.loads(pipeline.definition())["Steps"][0] == {
          "Name": "MyLambdaStep",
          "Type": "Lambda",
          "DependsOn": ["TestStep", "SecondTestStep"],
          "DisplayName": "MyLambdaStep",
          "Description": "MyLambdaStepDescription",
          "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:sagemaker_test_lambda",
          "OutputParameters": [
              {"OutputName": "output1", "OutputType": "String"},
              {"OutputName": "output2", "OutputType": "Boolean"},
          ],
          "Arguments": {
              "arg1": "foo",
              "arg2": 5,
              "arg3": {"Get": "Parameters.MyInt"},
          },
          "CacheConfig": {"Enabled": True, "ExpireAfter": "PT1H"},
      }
      adjacency_list = PipelineGraph.from_pipeline(
          pipeline
      ).adjacency_list
      assert ordered(adjacency_list) == ordered(
          {
              "MyLambdaStep": [],
              "TestStep": ["MyLambdaStep"],
              "SecondTestStep": ["MyLambdaStep"],
          }
      )
  
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 2 for calling a global function with example usage: test_lambda_step(sagemaker_session) without return types