airflow.providers.openlineage.utils.sql_hook_lineage

Utilities for processing hook-level lineage into OpenLineage events.

Attributes

log

Functions

emit_lineage_from_sql_extras(task_instance, sql_extras)

Process sql_job extras and emit per-query OpenLineage events.

Module Contents

airflow.providers.openlineage.utils.sql_hook_lineage.log[source]
airflow.providers.openlineage.utils.sql_hook_lineage.emit_lineage_from_sql_extras(task_instance, sql_extras, is_successful=True)[source]

Process sql_job extras and emit per-query OpenLineage events.

For each extra that contains sql text or job id:

  • Parse SQL via get_openlineage_facets_with_sql() to obtain inputs, outputs and facets (schema enrichment, column lineage, etc.).

  • Emit a separate START + COMPLETE/FAIL event pair (child job of the task).

Was this entry helpful?