Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Openlineage Prefect

Basic Configuration

At a minimum, define a namespace, Prefect API URL and transport consisting of a type, URL and endpoint. All three can be supplied using environment variables.

For example:

export OPENLINEAGE_NAMESPACE='prefect_test' &&
export OPENLINEAGE__TRANSPORT__TYPE='http' &&
export OPENLINEAGE__TRANSPORT__URL='http://lineageconsumer.com:5000' &&
export OPENLINEAGE__TRANSPORT__ENDPOINT='/api/v1/lineage' &&
export PREFECT_API_URL='http://prefecthost.com:4200/api'

For more details about OpenLineage transport options and how to configure them, consult the OpenLineage Python Client Documentation.

Execution

Import the openlineage_prefect package and execute collect_and_process_runs() asynchronously in its own process.

For example:

import asyncio
from openlineage_prefect.prefect_adapter.listener import PrefectOpenLineageListener

async def main():
    await PrefectOpenLineageListener().collect_and_process_runs()

if __name__ == "__main__":
    asyncio.run(main())

Datasets

The integration looks for datasets in Prefect Artifacts. To attach input and output datasets to job runs, use create_table_artifact() from the Artifact library. Provide a namespace, typically the dataset URI, and name to the adapter via an artifact's table and description, respectively. Distinguish the type of dataset by appending _output or _input to the description.

For example:

ol_table = [{"database_uri":"duckdb:///customers_db", "table":"customers"}]

create_table_artifact(
    key="upstream-insert",
    table=ol_table,
    description="ol-dataset_output"
)

Metadata

Release files for openlineage-prefect 0.0.1b8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openlineage-prefect 0.0.1b8
File Size Uploaded
openlineage_prefect-0.0.1b8.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openlineage-prefect 0.0.1b8
File Interpreter ABI Platform
openlineage_prefect-0.0.1b8-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / openlineage_prefect-0.0.1b8.tar.gz

Download URL openlineage_prefect-0.0.1b8.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b317f7601520ed0e8a0c106df6fa849f68f96cc2b53b7fc183cbad9d74ac6e8c
BLAKE2b-256 checksum
How to use checksums
ca737dc17bebf9d1438095b8f52ce6b8376dd370eab713b4d901e799f84905fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / openlineage_prefect-0.0.1b8-py3-none-any.whl

Download URL openlineage_prefect-0.0.1b8-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07003c463d918fcd9ec5d5d2edbfb7433a3805fae12849688b81fb8b8e4e7f11
BLAKE2b-256 checksum
How to use checksums
47b1903232be29dae7450f91c3c2743670bab01f4c63538812ab122edd7980ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page