Ingest pipeline metadata and dataset lineage into OpenLineage-compatible backends from a custom Python job

domain: openlineage.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install openlineage-python; configure a transport by setting the OPENLINEAGE_URL environment variable to your backend (e.g., a Marquez server at http://localhost:5000, or a Snowflake Horizon endpoint) and optionally OPENLINEAGE_API_KEY for authenticated backends
  2. Create a client: from openlineage.client import OpenLineageClient; client = OpenLineageClient.from_environment()
  3. Build a RunEvent using the builder: construct a Run with a generated UUID, a Job with namespace and name, input datasets as list of Dataset objects with namespace/name, and output datasets similarly; set eventType to START at job begin and COMPLETE or FAIL at job end
  4. Emit the event with client.emit(run_event); for COMPLETE events, attach SchemaDatasetFacet to dataset objects to send column-level schema information alongside the lineage, enabling column-level lineage tracking in supporting backends
  5. Validate that events are received by querying the backend API (e.g., GET /api/v1/namespaces/{namespace}/jobs or the equivalent Snowflake Horizon lineage endpoint if using the OpenLineage public preview feature)

Known gotchas

Related routes

Set up OpenLineage with the dbt integration to emit dataset-level lineage events to Marquez or another compatible backend
openlineage.io · 5 steps · unrated
Ingest table-level and column-level lineage into DataHub via the Python SDK
docs.datahub.com · 5 steps · unrated
Amazon SageMaker Pipelines: build a pipeline with Processing, Training, and RegisterModel steps using the SageMaker Python SDK
ml-ops · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans