code: def test_emr_step_with_one_step_config(
      sagemaker_session, execution_role_arn
  ):
      emr_step_config = EMRStepConfig(
          jar="s3:/script-runner/script-runner.jar",
          args=["--arg_0", "arg_0_value"],
          main_class="com.my.main",
          properties=[
              {"Key": "Foo", "Value": "Foo_value"},
              {"Key": "Bar", "Value": "Bar_value"},
          ],
      )
  
      emr_step = EMRStep(
          name="MyEMRStep",
          display_name="MyEMRStep",
          description="MyEMRStepDescription",
          cluster_id="MyClusterID",
          step_config=emr_step_config,
          depends_on=["TestStep"],
          cache_config=CacheConfig(
              enable_caching=True, expire_after="PT1H"
          ),
          execution_role_arn=execution_role_arn,
      )
      emr_step.add_depends_on(["SecondTestStep"])
  
      expected_request = {
          "Name": "MyEMRStep",
          "Type": "EMR",
          "Arguments": {
              "ClusterId": "MyClusterID",
              "StepConfig": {
                  "HadoopJarStep": {
                      "Args": ["--arg_0", "arg_0_value"],
                      "Jar": "s3:/script-runner/script-runner.jar",
                      "MainClass": "com.my.main",
                      "Properties": [
                          {"Key": "Foo", "Value": "Foo_value"},
                          {"Key": "Bar", "Value": "Bar_value"},
                      ],
                  }
              },
          },
          "DependsOn": ["TestStep", "SecondTestStep"],
          "DisplayName": "MyEMRStep",
          "Description": "MyEMRStepDescription",
          "CacheConfig": {"Enabled": True, "ExpireAfter": "PT1H"},
      }
  
      if execution_role_arn is not None:
          expected_request["Arguments"][
              "ExecutionRoleArn"
          ] = execution_role_arn
  
      assert emr_step.to_request() == expected_request
      assert emr_step.properties.ClusterId == "MyClusterID"
      assert (
          emr_step.properties.ExecutionRoleArn == execution_role_arn
          if execution_role_arn is not None
          else True
      )
      assert emr_step.properties.ActionOnFailure.expr == {
          "Get": "Steps.MyEMRStep.ActionOnFailure"
      }
      assert emr_step.properties.Config.Args.expr == {
          "Get": "Steps.MyEMRStep.Config.Args"
      }
      assert emr_step.properties.Config.Jar.expr == {
          "Get": "Steps.MyEMRStep.Config.Jar"
      }
      assert emr_step.properties.Config.MainClass.expr == {
          "Get": "Steps.MyEMRStep.Config.MainClass"
      }
      assert emr_step.properties.Id.expr == {
          "Get": "Steps.MyEMRStep.Id"
      }
      assert emr_step.properties.Name.expr == {
          "Get": "Steps.MyEMRStep.Name"
      }
      assert emr_step.properties.Status.State.expr == {
          "Get": "Steps.MyEMRStep.Status.State"
      }
      assert emr_step.properties.Status.FailureDetails.Reason.expr == {
          "Get": "Steps.MyEMRStep.Status.FailureDetails.Reason"
      }
      assert (
          emr_step.properties.Status.FailureDetails.Reason._referenced_steps
          == [emr_step]
      )
  
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 1 for calling a global function with example usage: test_emr_step_with_one_step_config(sagemaker_session, execution_role_arn) without return types