OpenLineage Integration Common Library

1.46.0 · active · verified Thu Apr 09

The `openlineage-integration-common` library provides shared data models, utilities, and provider interfaces for building OpenLineage integrations in Python. It is a foundational component often used by other OpenLineage libraries (like `openlineage-python`) and custom integrations. The current version is 1.46.0, and it follows a frequent release cadence, often updated alongside the main OpenLineage project.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use fundamental data models like `DbTableSchema`, `Source`, and `SQLStatement` provided by `openlineage-integration-common`. These models are essential building blocks when developing custom OpenLineage integrations or working with parsed metadata.

from openlineage.common.models import DbTableSchema, Source
from openlineage.common.provider import SQLStatement

# Example: Defining a database table schema
db_table = DbTableSchema(
    schema='public',
    table='my_table',
    fields=[
        {'name': 'id', 'type': 'int'},
        {'name': 'name', 'type': 'string'}
    ]
)
print(f"Defined DB Table: {db_table.json(indent=2)}")

# Example: Defining a data source
my_source = Source(scheme='postgresql', authority='localhost:5432', connection_url='jdbc:postgresql://localhost:5432/mydb')
print(f"Defined Source: {my_source.json(indent=2)}")

# Example: Representing a SQL statement (without actual parsing logic)
sql_statement = SQLStatement(query='SELECT * FROM public.my_table')
print(f"SQL Statement: {sql_statement.json(indent=2)}")

view raw JSON →