airflow.providers.amazon.aws.utils.waiter

Module Contents

Classes

WaitPolicy

Used to control the waiting behaviour within EMRClusterJobFlowOperator.

Functions

waiter(get_state_callable, get_state_args, ...[, ...])

Call get_state_callable until it reaches the desired_state or the failure_states.

get_state(response, keys)

Attributes

log

WAITER_POLICY_NAME_MAPPING

airflow.providers.amazon.aws.utils.waiter.log[source]
airflow.providers.amazon.aws.utils.waiter.waiter(get_state_callable, get_state_args, parse_response, desired_state, failure_states, object_type, action, countdown=25 * 60, check_interval_seconds=60)[source]

Call get_state_callable until it reaches the desired_state or the failure_states.

PLEASE NOTE: While not yet deprecated, we are moving away from this method

and encourage using the custom boto waiters as explained in https://github.com/apache/airflow/tree/main/airflow/providers/amazon/aws/waiters

Parameters
  • get_state_callable (Callable) – A callable to run until it returns True

  • get_state_args (dict) – Arguments to pass to get_state_callable

  • parse_response (list) – Dictionary keys to extract state from response of get_state_callable

  • desired_state (set) – Wait until the getter returns this value

  • failure_states (set) – A set of states which indicate failure and should throw an exception if any are reached before the desired_state

  • object_type (str) – Used for the reporting string. What are you waiting for? (application, job, etc)

  • action (str) – Used for the reporting string. What action are you waiting for? (created, deleted, etc)

  • countdown (int | float | None) – Number of seconds the waiter should wait for the desired state before timing out. Defaults to 25 * 60 seconds. None = infinite.

  • check_interval_seconds (int) – Number of seconds waiter should wait before attempting to retry get_state_callable. Defaults to 60 seconds.

airflow.providers.amazon.aws.utils.waiter.get_state(response, keys)[source]
class airflow.providers.amazon.aws.utils.waiter.WaitPolicy[source]

Bases: str, enum.Enum

Used to control the waiting behaviour within EMRClusterJobFlowOperator.

Choices: - WAIT_FOR_COMPLETION - Will wait for the cluster to report “Running” state - WAIT_FOR_STEPS_COMPLETION - Will wait for the cluster to report “Terminated” state

WAIT_FOR_COMPLETION = 'wait_for_completion'[source]
WAIT_FOR_STEPS_COMPLETION = 'wait_for_steps_completion'[source]
airflow.providers.amazon.aws.utils.waiter.WAITER_POLICY_NAME_MAPPING: dict[WaitPolicy, str][source]

Was this entry helpful?