Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.providers.google.cloud.triggers.cloud_sql

This module contains Google Cloud SQL triggers.

Classes

CloudSQLExportTrigger

Trigger that periodically polls information from Cloud SQL API to verify job status.

CloudSQLNoOperationInProgressTrigger

Trigger that waits until a Cloud SQL instance has no administrative operation in progress.

Module Contents

class airflow.providers.google.cloud.triggers.cloud_sql.CloudSQLExportTrigger(operation_name, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, poke_interval=20, api_version='v1beta4')[source]

Bases: airflow.triggers.base.BaseTrigger

Trigger that periodically polls information from Cloud SQL API to verify job status.

Implementation leverages asynchronous transport.

gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
operation_name[source]
project_id = None[source]
poke_interval = 20[source]
api_version = 'v1beta4'[source]
hook[source]
serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns:

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

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_sql.CloudSQLNoOperationInProgressTrigger(instance, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, poke_interval=20, api_version='v1beta4')[source]

Bases: airflow.triggers.base.BaseTrigger

Trigger that waits until a Cloud SQL instance has no administrative operation in progress.

Polls sqladmin.operations.list for the target instance and fires once no operation is in a non-terminal state (PENDING/RUNNING). Fails fast on 403/404 (the instance is missing or access is denied) rather than polling until timeout.

instance[source]
project_id = None[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
poke_interval = 20[source]
api_version = 'v1beta4'[source]
hook[source]
serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns:

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

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?