astronomer.providers.dbt.cloud.operators.dbt

Module Contents

Classes

DbtCloudRunJobOperatorAsync

Executes a dbt Cloud job asynchronously. Trigger the dbt cloud job via worker to dbt and with run id in response

class astronomer.providers.dbt.cloud.operators.dbt.DbtCloudRunJobOperatorAsync(*, dbt_cloud_conn_id=DbtCloudHook.default_conn_name, job_id, account_id=None, trigger_reason=None, steps_override=None, schema_override=None, wait_for_termination=True, timeout=60 * 60 * 24 * 7, check_interval=60, additional_run_config=None, deferrable=False, **kwargs)[source]

Bases: airflow.providers.dbt.cloud.operators.dbt.DbtCloudRunJobOperator

Executes a dbt Cloud job asynchronously. Trigger the dbt cloud job via worker to dbt and with run id in response poll for the status in trigger.

See also

For more information on sync Operator DbtCloudRunJobOperator, take a look at the guide: Trigger a dbt Cloud Job

Parameters:
  • dbt_cloud_conn_id (str) – The connection ID for connecting to dbt Cloud.

  • job_id (int) – The ID of a dbt Cloud job.

  • account_id (int | None) – Optional. The ID of a dbt Cloud account.

  • trigger_reason (str | None) – Optional Description of the reason to trigger the job. Dbt requires the trigger reason while making an API. if it is not provided uses the default reasons.

  • steps_override (list[str] | None) – Optional. List of dbt commands to execute when triggering the job instead of those configured in dbt Cloud.

  • schema_override (str | None) – Optional. Override the destination schema in the configured target for this job.

  • timeout (int) – Time in seconds to wait for a job run to reach a terminal status. Defaults to 7 days.

  • check_interval (int) – Time in seconds to check on a job run’s status. Defaults to 60 seconds.

  • additional_run_config (dict[str, Any] | None) – Optional. Any additional parameters that should be included in the API request when triggering the job.

Returns:

The ID of the triggered dbt Cloud job run.

execute(context)[source]

Submits a job which generates a run_id and gets deferred

execute_complete(context, event)[source]

Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful.