OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Support Task Level Lineage from Airflow

Open mlecuyer-dna opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe.

Yes. When an airflow pipeline that is more complex than a single ETL from A -> B, such as A -(task)-> B -(task)-> C, non-existent direct relationships are formed between tables, such that A -> [B,C] even though C is only derived from B

Describe the solution you'd like

High Level - Backend

Lineage ingestion from airflow should be able to build the graph using the inlets and outlets from each individual task, as well as the DAG level.

  • Inlets/outlets defined at the DAG level should be processed in the same way as current airflow lineage (I.E. a fully connected graph)
  • Inlets/outlets defined in the task level should Treat each task as a separate edge between two sources.

For example, given the following dag:

DAG_1 DAG(inlets=[D_1, D_3] Outlets=[D_2, D_4]:
  task_1 = task(inlet=T_1, outlet=T_2)

  task_2 = task(inlet=T_2, T_3, outlet = T_4)

We should have the following lineages generated:

D_1 -- (DAG_1) --> [D_2, D_4]
D_3 --(DAG_1) --> [D_2,D_4]

T_1 --(task_1) --> T_2
[T_2, T_3] --(task_2) --> T_4

High Level - Models

  • Some sort of child Entity should be created to map Tasks to their parent Pipeline, or alternatively, create a Workflow Entity that would consist of multiple Pipelines, though the latter would be a more breaking change most likely.
  • This Entity should contain information about its parent, and should not be able to exist without a Parent (as a task without a DAG is meaningless)
  • Tasks should be able to have separate owners but should default to inheriting ownership from their parent
  • Tasks should be able to be assigned as an Edge in lineage graphs
  • Documentation should clearly delineate between Task and DAG level lineage, as well as how to enable both, with clear code examples

Describe alternatives you've considered

  • Attempted to work with the existing Key parameter of DAG level lineage, but did not

Additional context

  • The current implementation for airflow lineage will create a cross join of all collected inlets from task level and all collected outlets from task level, as well as dag-level inlets/outlets.
  • This creates lots of recursive/self-referential lineage, as well as a densely connected graph that doesn't accurately represent the true lineage of the data sources.

mlecuyer-dna avatar Apr 07 '25 19:04 mlecuyer-dna

Ah, I’ve been looking for exactly this improvement! My pipeline follows a similar pattern where multiple transformations occur within the same Airflow DAG, namely staging->silver->gold in our data warehouse. Ideally, I’d like to see the lineage reflect that step-by-step flow. Since inlets and outlets can currently only be defined at the DAG level, I end up with a lot of extra dependencies that don’t actually exist. Really hope this feature gets implemented soon, it would make the lineage much clearer and more useful!

Image

pvkuiken avatar May 19 '25 11:05 pvkuiken

Hello @ulixius9, do you have any insight into the timeline for this feature? Specifically, is it likely to land in a 1.10.x release, or is it currently slated for 1.11.0

aimen-denche avatar Sep 15 '25 07:09 aimen-denche

Image

hello, I'am hitting the same limitation where lineage at the DAG level creates dependencies that don't actually exist between tasks, it would be much better if we could define lineage more granularly, is there any timeline for when this might be available? thanks you.

yaniszuck avatar Sep 29 '25 19:09 yaniszuck

@ulixius9 @Prajwal214 do we have an update fot this one ?

aimen-denche avatar Oct 14 '25 15:10 aimen-denche

Hey OpenMetadata Team, is this feature gonna be added in next major release? we have same issue

KaramBil avatar Nov 18 '25 15:11 KaramBil

@ulixius9 Lets discuss this

harshach avatar Feb 02 '26 17:02 harshach