airflow.providers.dbt.cloud.operators.dbt
¶
Module Contents¶
Classes¶
Operator link for DbtCloudRunJobOperator. This link allows users to monitor the triggered job run |
|
Executes a dbt Cloud job. |
|
Download artifacts from a dbt Cloud job run. |
- class airflow.providers.dbt.cloud.operators.dbt.DbtCloudRunJobOperatorLink[source]¶
Bases:
airflow.models.BaseOperatorLink
Operator link for DbtCloudRunJobOperator. This link allows users to monitor the triggered job run directly in dbt Cloud.
- get_link(operator, dttm=None, *, ti_key=None)[source]¶
Link to external system.
Note: The old signature of this function was
(self, operator, dttm: datetime)
. That is still supported at runtime but is deprecated.- Parameters
operator – The Airflow operator object this link is associated to.
ti_key – TaskInstance ID to return link for.
- Returns
link to external system
- class airflow.providers.dbt.cloud.operators.dbt.DbtCloudRunJobOperator(*, 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, **kwargs)[source]¶
Bases:
airflow.models.BaseOperator
Executes a dbt Cloud job.
See also
For more information on how to use this operator, 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 (Optional[int]) – Optional. The ID of a dbt Cloud account.
trigger_reason (Optional[str]) – Optional. Description of the reason to trigger the job.
steps_override (Optional[List[str]]) – Optional. List of dbt commands to execute when triggering the job instead of those configured in dbt Cloud.
schema_override (Optional[str]) – Optional. Override the destination schema in the configured target for this job.
wait_for_termination (bool) – Flag to wait on a job run’s termination. By default, this feature is enabled but could be disabled to perform an asynchronous wait for a long-running job run execution using the
DbtCloudJobRunSensor
.timeout (int) – Time in seconds to wait for a job run to reach a terminal status for non-asynchronous waits. Used only if
wait_for_termination
is True. Defaults to 7 days.check_interval (int) – Time in seconds to check on a job run’s status for non-asynchronous waits. Used only if
wait_for_termination
is True. Defaults to 60 seconds.additional_run_config (Optional[Dict[str, Any]]) – 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.
- template_fields = ['dbt_cloud_conn_id', 'job_id', 'account_id', 'trigger_reason', 'steps_override',...[source]¶
- class airflow.providers.dbt.cloud.operators.dbt.DbtCloudGetJobRunArtifactOperator(*, dbt_cloud_conn_id=DbtCloudHook.default_conn_name, run_id, path, account_id=None, step=None, output_file_name=None, **kwargs)[source]¶
Bases:
airflow.models.BaseOperator
Download artifacts from a dbt Cloud job run.
See also
For more information on how to use this operator, take a look at the guide: Download run artifacts
- Parameters
dbt_cloud_conn_id (str) – The connection ID for connecting to dbt Cloud.
run_id (int) – The ID of a dbt Cloud job run.
path (str) – The file path related to the artifact file. Paths are rooted at the target/ directory. Use “manifest.json”, “catalog.json”, or “run_results.json” to download dbt-generated artifacts for the run.
account_id (Optional[int]) – Optional. The ID of a dbt Cloud account.
step (Optional[int]) – Optional. The index of the Step in the Run to query for artifacts. The first step in the run has the index 1. If the step parameter is omitted, artifacts for the last step in the run will be returned.
output_file_name (Optional[str]) – Optional. The desired file name for the download artifact file. Defaults to <run_id>_<path> (e.g. “728368_run_results.json”).