airflow.providers.dbt.cloud.utils.openlineage¶
Attributes¶
Functions¶
Replace the dbt Cloud run |
|
Generate OpenLineage events from the DBT Cloud run. |
Module Contents¶
- airflow.providers.dbt.cloud.utils.openlineage.inject_parent_job_information_into_dbt_cloud_cause(cause, task_instance)[source]¶
Replace the dbt Cloud run
causewith OpenLineage parent job information as JSON.This serializes the Airflow task’s OpenLineage parent (and root) run identifiers into the triggered run’s
causefield. A consumer that reads dbt Cloud runs can parse this JSON and attach aParentRunFacet, linking the dbt Cloud run back to the Airflow task that triggered it.The dbt Cloud
causeis limited toDBT_CAUSE_MAX_LENGTHcharacters. The essentialparentlink is always kept; therootblock is dropped if the two together do not fit. If even the parent-only payload does not fit, the originalcauseis returned unchanged.
- airflow.providers.dbt.cloud.utils.openlineage.generate_openlineage_events_from_dbt_cloud_run(operator, task_instance)[source]¶
Generate OpenLineage events from the DBT Cloud run.
This function retrieves information about a DBT Cloud run, including the associated job, project, and execution details. It processes the run’s artifacts, such as the manifest and run results, in parallel for many steps. Then it generates and emits OpenLineage events based on the executed DBT tasks.
- Parameters:
operator (airflow.providers.dbt.cloud.operators.dbt.DbtCloudRunJobOperator | airflow.providers.dbt.cloud.sensors.dbt.DbtCloudJobRunSensor) – Instance of DBT Cloud operator that executed DBT tasks. It already should have run_id and dbt cloud hook.
task_instance (airflow.models.taskinstance.TaskInstance) – Currently executed task instance
- Returns:
An empty OperatorLineage object indicating the completion of events generation.
- Return type:
airflow.providers.openlineage.extractors.OperatorLineage