code: def test_pipeline_interpolates_emr_outputs(sagemaker_session):
      custom_step = CustomStep("TestStep")
      parameter = ParameterString("MyStr")
  
      emr_step_config_1 = EMRStepConfig(
          jar="s3:/script-runner/script-runner_1.jar",
          args=["--arg_0", "arg_0_value"],
          main_class="com.my.main",
          properties=[
              {"Key": "Foo", "Value": "Foo_value"},
              {"Key": "Bar", "Value": "Bar_value"},
          ],
      )
  
      step_emr_1 = EMRStep(
          name="emr_step_1",
          cluster_id="MyClusterID",
          display_name="emr_step_1",
          description="MyEMRStepDescription",
          depends_on=[custom_step],
          step_config=emr_step_config_1,
      )
  
      emr_step_config_2 = EMRStepConfig(
          jar="s3:/script-runner/script-runner_2.jar"
      )
  
      step_emr_2 = EMRStep(
          name="emr_step_2",
          cluster_id="MyClusterID",
          display_name="emr_step_2",
          description="MyEMRStepDescription",
          depends_on=[custom_step],
          step_config=emr_step_config_2,
      )
  
      pipeline = Pipeline(
          name="MyPipeline",
          parameters=[parameter],
          steps=[step_emr_1, step_emr_2, custom_step],
          sagemaker_session=sagemaker_session,
      )
  
      pipeline_def = json.loads(pipeline.definition())
      assert ordered(pipeline_def) == ordered(
          {
              "Version": "2020-12-01",
              "Metadata": {},
              "Parameters": [{"Name": "MyStr", "Type": "String"}],
              "PipelineExperimentConfig": {
                  "ExperimentName": {"Get": "Execution.PipelineName"},
                  "TrialName": {"Get": "Execution.PipelineExecutionId"},
              },
              "Steps": [
                  {
                      "Name": "emr_step_1",
                      "Type": "EMR",
                      "Arguments": {
                          "ClusterId": "MyClusterID",
                          "StepConfig": {
                              "HadoopJarStep": {
                                  "Args": ["--arg_0", "arg_0_value"],
                                  "Jar": "s3:/script-runner/script-runner_1.jar",
                                  "MainClass": "com.my.main",
                                  "Properties": [
                                      {
                                          "Key": "Foo",
                                          "Value": "Foo_value",
                                      },
                                      {
                                          "Key": "Bar",
                                          "Value": "Bar_value",
                                      },
                                  ],
                              }
                          },
                      },
                      "DependsOn": ["TestStep"],
                      "Description": "MyEMRStepDescription",
                      "DisplayName": "emr_step_1",
                  },
                  {
                      "Name": "emr_step_2",
                      "Type": "EMR",
                      "Arguments": {
                          "ClusterId": "MyClusterID",
                          "StepConfig": {
                              "HadoopJarStep": {
                                  "Jar": "s3:/script-runner/script-runner_2.jar"
                              }
                          },
                      },
                      "Description": "MyEMRStepDescription",
                      "DisplayName": "emr_step_2",
                      "DependsOn": ["TestStep"],
                  },
                  {
                      "Name": "TestStep",
                      "Type": "Training",
                      "Arguments": {},
                  },
              ],
          }
      )
      adjacency_list = PipelineGraph.from_pipeline(
          pipeline
      ).adjacency_list
      assert ordered(adjacency_list) == ordered(
          {
              "emr_step_1": [],
              "emr_step_2": [],
              "TestStep": ["emr_step_1", "emr_step_2"],
          }
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_emr_step.py
imports: from __future__ import absolute_import
  import json
  import pytest
  from sagemaker.workflow.emr_step import EMRStep, EMRStepConfig, ERR_STR_WITH_NAME_AUTO_TERMINATION_OR_STEPS, ERR_STR_WITHOUT_INSTANCE, ERR_STR_WITH_KEEPJOBFLOW_OR_TERMINATIONPROTECTED, ERR_STR_BOTH_OR_NONE_INSTANCEGROUPS_OR_INSTANCEFLEETS, ERR_STR_WITH_BOTH_CLUSTER_ID_AND_CLUSTER_CFG, ERR_STR_WITHOUT_CLUSTER_ID_AND_CLUSTER_CFG, ERR_STR_WITH_EXEC_ROLE_ARN_AND_WITHOUT_CLUSTER_ID
  from sagemaker.workflow.steps import CacheConfig
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.parameters import ParameterString
  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_pipeline_interpolates_emr_outputs(sagemaker_session) without return types