connectors

No menu items for this category

Configuring DAG Lineage

Regardless of the Airflow ingestion process you follow (Workflow, Lineage Backend or Lineage Operator), OpenMetadata will try to extract the lineage information based on the tasks inlets and outlets.

What it's important to consider here is that when we are ingesting Airflow lineage, we are actually building a graph:

Where tables are nodes and DAGs (Pipelines) are considered edges. This means that the correct way of setting these parameters is by making sure that we are informing both inlets and outlets, so that we have the nodes to build the relationship.

We support lineage for the following entities: Table, Container, Dashboard, DashboardDataModel, Pipeline, Topic, SearchIndex and MlModel.

Moreover, note that this example requires the openmetadata-ingestion package to be installed. If you are planning to ingest the Airflow metadata (and lineage) externally and don't want to install it, please refer to the next section.

Let's take a look at the following example:

We are passing inlets and outlets as a list of the OMEntity class, that lets us specify:

  1. The type of the asset we are using: Table, Container,... following our SDK
  2. The FQN of the asset, which is the unique name of each asset in OpenMetadata, e.g., serviceName.databaseName.schemaName.tableName.
  3. The key to group the lineage if needed.

This OMEntity class is defined following the example of Airflow's internal lineage models.

We can inform the lineage dependencies among different groups of tables. In the example above, we are not building the lineage from all inlets to all outlets, but rather grouping the tables by key (group_A and group_B). This means that after this lineage is processed, the relationship will be:

and

It does not matter in which task of the DAG these inlet/outlet information is specified. During the ingestion process we group all these details at the DAG level.

We can apply the same example as above but describing the lineage in dictionaries instead, in order to not require the openmetadata-ingestion package to be installed in the environment.

We are passing inlets and outlets as a list of dictionaries, that lets us specify:

  1. The type of the asset we are using: Table, Container,... following the list below.
  2. The FQN of the asset, which is the unique name of each asset in OpenMetadata, e.g., serviceName.databaseName.schemaName.tableName.
  3. The key to group the lineage if needed.

The entity key needs to be informed as follows for each of the entity types:

  • Table: table
  • Container: container
  • Dashboard: dashboard
  • Dashboard Data Model: dashboardDataModel
  • Pipeline: pipeline
  • Topic: topic
  • SearchIndex: searchIndex
  • MlModel: mlmodel

Note that this method only allows lineage between Tables.

We will deprecate it in OpenMetadata 1.4

Let's take a look at the following example:

Make sure to add the table Fully Qualified Name (FQN), which is the unique name of the table in OpenMetadata.

This name is composed as serviceName.databaseName.schemaName.tableName.