airflow.providers.amazon.aws.sensors.emr_step

Module Contents

class airflow.providers.amazon.aws.sensors.emr_step.EmrStepSensor(*, job_flow_id: str, step_id: str, target_states: Optional[Iterable[str]] = None, failed_states: Optional[Iterable[str]] = None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.sensors.emr_base.EmrBaseSensor

Asks for the state of the step until it reaches any of the target states. If it fails the sensor errors, failing the task.

With the default target states, sensor waits step to be completed.

Parameters
  • job_flow_id (str) -- job_flow_id which contains the step check the state of

  • step_id (str) -- step to check the state of

  • target_states (list[str]) -- the target states, sensor waits until step reaches any of these states

  • failed_states (list[str]) -- the failure states, sensor fails when step reaches any of these states

template_fields = ['job_flow_id', 'step_id', 'target_states', 'failed_states'][source]
template_ext = [][source]
get_emr_response(self)[source]

Make an API call with boto3 and get details about the cluster step.

Returns

response

Return type

dict[str, Any]

static state_from_response(response: Dict[str, Any])[source]

Get state from response dictionary.

Parameters

response (dict[str, Any]) -- response from AWS API

Returns

execution state of the cluster step

Return type

str

static failure_message_from_response(response: Dict[str, Any])[source]

Get failure message from response dictionary.

Parameters

response (dict[str, Any]) -- response from AWS API

Returns

failure message

Return type

Optional[str]

Was this entry helpful?