airflow.providers.google.cloud.triggers.cloud_composer

Module Contents

Classes

CloudComposerExecutionTrigger

The trigger handles the async communication with the Google Cloud Composer.

CloudComposerAirflowCLICommandTrigger

The trigger wait for the Airflow CLI command result.

CloudComposerDAGRunTrigger

The trigger wait for the DAG run completion.

class airflow.providers.google.cloud.triggers.cloud_composer.CloudComposerExecutionTrigger(project_id, region, operation_name, gcp_conn_id='google_cloud_default', impersonation_chain=None, pooling_period_seconds=30)[source]

Bases: airflow.triggers.base.BaseTrigger

The trigger handles the async communication with the Google Cloud Composer.

serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns

Tuple of (class path, keyword arguments needed to re-instantiate).

Return type

tuple[str, dict[str, Any]]

async run()[source]

Run the trigger in an asynchronous context.

The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.

If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).

In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.

class airflow.providers.google.cloud.triggers.cloud_composer.CloudComposerAirflowCLICommandTrigger(project_id, region, environment_id, execution_cmd_info, gcp_conn_id='google_cloud_default', impersonation_chain=None, poll_interval=10)[source]

Bases: airflow.triggers.base.BaseTrigger

The trigger wait for the Airflow CLI command result.

serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns

Tuple of (class path, keyword arguments needed to re-instantiate).

Return type

tuple[str, dict[str, Any]]

async run()[source]

Run the trigger in an asynchronous context.

The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.

If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).

In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.

class airflow.providers.google.cloud.triggers.cloud_composer.CloudComposerDAGRunTrigger(project_id, region, environment_id, composer_dag_id, start_date, end_date, allowed_states, gcp_conn_id='google_cloud_default', impersonation_chain=None, poll_interval=10)[source]

Bases: airflow.triggers.base.BaseTrigger

The trigger wait for the DAG run completion.

serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns

Tuple of (class path, keyword arguments needed to re-instantiate).

Return type

tuple[str, dict[str, Any]]

async run()[source]

Run the trigger in an asynchronous context.

The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.

If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).

In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.

Was this entry helpful?