code: def test_emr_step_with_valid_cluster_config():
      emr_step = EMRStep(
          name=g_emr_step_name,
          display_name="MyEMRStep",
          description="MyEMRStepDescription",
          cluster_id=None,
          cluster_config=g_cluster_config,
          step_config=g_emr_step_config,
          cache_config=CacheConfig(
              enable_caching=True, expire_after="PT1H"
          ),
      )
  
      assert emr_step.to_request() == {
          "Name": "MyEMRStep",
          "Type": "EMR",
          "Arguments": {
              "StepConfig": {
                  "HadoopJarStep": {
                      "Jar": "s3:/script-runner/script-runner.jar"
                  }
              },
              "ClusterConfig": {
                  "AdditionalInfo": "MyAdditionalInfo",
                  "AmiVersion": "3.8.0",
                  "Instances": {
                      "HadoopVersion": "MyHadoopVersion",
                      "InstanceCount": 1,
                      "InstanceGroups": [
                          {
                              "InstanceCount": 1,
                              "InstanceRole": "MASTER",
                              "InstanceType": "m1.small",
                              "Market": "ON_DEMAND",
                              "Name": "Master Instance Group",
                          }
                      ],
                  },
              },
          },
          "DisplayName": "MyEMRStep",
          "Description": "MyEMRStepDescription",
          "CacheConfig": {"Enabled": True, "ExpireAfter": "PT1H"},
      }
  
      pipeline = Pipeline(name="MyPipeline", steps=[emr_step])
  
      assert json.loads(pipeline.definition()) == {
          "Version": "2020-12-01",
          "Metadata": {},
          "Parameters": [],
          "PipelineExperimentConfig": {
              "ExperimentName": {"Get": "Execution.PipelineName"},
              "TrialName": {"Get": "Execution.PipelineExecutionId"},
          },
          "Steps": [
              {
                  "Name": "MyEMRStep",
                  "Type": "EMR",
                  "Arguments": {
                      "StepConfig": {
                          "HadoopJarStep": {
                              "Jar": "s3:/script-runner/script-runner.jar"
                          }
                      },
                      "ClusterConfig": {
                          "AdditionalInfo": "MyAdditionalInfo",
                          "AmiVersion": "3.8.0",
                          "Instances": {
                              "HadoopVersion": "MyHadoopVersion",
                              "InstanceCount": 1,
                              "InstanceGroups": [
                                  {
                                      "InstanceCount": 1,
                                      "InstanceRole": "MASTER",
                                      "InstanceType": "m1.small",
                                      "Market": "ON_DEMAND",
                                      "Name": "Master Instance Group",
                                  }
                              ],
                          },
                      },
                  },
                  "DisplayName": "MyEMRStep",
                  "Description": "MyEMRStepDescription",
                  "CacheConfig": {
                      "Enabled": True,
                      "ExpireAfter": "PT1H",
                  },
              }
          ],
      }
  
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 6 for calling a global function with example usage: test_emr_step_with_valid_cluster_config() without return types