astronomer.providers.google.cloud.triggers.dataproc

Classes

DataprocCreateClusterTrigger

Asynchronously check the status of a cluster

DataprocDeleteClusterTrigger

Asynchronously check the status of a cluster

DataProcSubmitTrigger

Check for the state of a previously submitted Dataproc job.

Module Contents

class astronomer.providers.google.cloud.triggers.dataproc.DataprocCreateClusterTrigger(*, project_id=None, region=None, cluster_name, end_time, metadata=(), delete_on_error=True, cluster_config=None, labels=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, polling_interval=5.0, **kwargs)[source]

Bases: airflow.triggers.base.BaseTrigger

Asynchronously check the status of a cluster

This class is deprecated and will be removed in 2.0.0. Use :class: ~airflow.providers.google.cloud.triggers.dataproc.DataprocClusterTrigger instead

Parameters:
  • project_id (str | None) – The ID of the Google Cloud project the cluster belongs to

  • region (str | None) – The Cloud Dataproc region in which to handle the request

  • cluster_name (str) – The name of the cluster

  • end_time (float) – Time in second left to check the cluster status

  • metadata (Sequence[tuple[str, str]]) – Additional metadata that is provided to the method

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account.

  • polling_interval (float) – Time in seconds to sleep between checks of cluster status

project_id
region
cluster_name
end_time
metadata
delete_on_error
cluster_config
labels
gcp_conn_id
impersonation_chain
polling_interval
serialize()[source]

Serializes DataprocCreateClusterTrigger arguments and classpath.

async run()[source]

Check the status of cluster until reach the terminal state

class astronomer.providers.google.cloud.triggers.dataproc.DataprocDeleteClusterTrigger(cluster_name, end_time, project_id=None, region=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, polling_interval=5.0, **kwargs)[source]

Bases: airflow.triggers.base.BaseTrigger

Asynchronously check the status of a cluster

This class is deprecated and will be removed in 2.0.0. Use :class: ~airflow.providers.google.cloud.triggers.dataproc.DataprocDeleteClusterTrigger instead

Parameters:
  • cluster_name (str) – The name of the cluster

  • end_time (float) – Time in second left to check the cluster status

  • project_id (str | None) – The ID of the Google Cloud project the cluster belongs to

  • region (str | None) – The Cloud Dataproc region in which to handle the request

  • metadata (Sequence[tuple[str, str]]) – Additional metadata that is provided to the method

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account.

  • polling_interval (float) – Time in seconds to sleep between checks of cluster status

cluster_name
end_time
project_id
region
metadata
gcp_conn_id
impersonation_chain
polling_interval
serialize()[source]

Serializes DataprocDeleteClusterTrigger arguments and classpath.

async run()[source]

Wait until cluster is deleted completely

class astronomer.providers.google.cloud.triggers.dataproc.DataProcSubmitTrigger(*, dataproc_job_id, region=None, project_id=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, polling_interval=5.0)[source]

Bases: airflow.triggers.base.BaseTrigger

Check for the state of a previously submitted Dataproc job.

This class is deprecated and will be removed in 2.0.0. Use :class: ~ airflow.providers.google.cloud.triggers.dataproc.DataprocSubmitTrigger instead

Parameters:
  • dataproc_job_id (str) – The Dataproc job ID to poll. (templated)

  • region (str | None) – Required. The Cloud Dataproc region in which to handle the request. (templated)

  • project_id (str | None) – The ID of the google cloud project in which to create the cluster. (templated)

  • gcp_conn_id (str) – The connection ID to use connecting to Google Cloud Platform.

  • impersonation_chain (str | Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account.

project_id
gcp_conn_id
dataproc_job_id
region
impersonation_chain
polling_interval
serialize()[source]

Serializes DataProcSubmitTrigger arguments and classpath.

async run()[source]

Simple loop until the job running on Google Cloud DataProc is completed or not