Ingest table-level and column-level lineage into DataHub via the Python SDK

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

Steps

  1. Install datahub using pip install acryl-datahub; configure the REST emitter by creating a DatahubRestEmitter pointing to your DataHub GMS endpoint (e.g., http://localhost:8080) and a DataHub access token if auth is enabled
  2. Create UpstreamLineageClass objects for table-level lineage: define a list of Upstream entries each containing a dataset URN and a DatasetLineageTypeClass (such as TRANSFORMED); wrap them in an UpstreamLineageClass and emit as a MetadataChangeProposalWrapper for the target dataset URN
  3. For column-level lineage, create FineGrainedLineageClass entries mapping upstream fieldPaths to downstream fieldPaths; include these in an UpstreamLineageClass alongside the table-level entries
  4. Emit the lineage event using emitter.emit(mcp) where mcp is a MetadataChangeProposalWrapper; for large graphs, use the DatahubRestEmitter batch context manager to send multiple MCPs in a single request
  5. Verify lineage in the DataHub UI under the Lineage tab of the affected dataset, or query the GraphQL endpoint with searchAcrossLineage to validate upstream and downstream propagation

Known gotchas

Related routes

Ingest pipeline metadata and dataset lineage into OpenLineage-compatible backends from a custom Python job
openlineage.io · 5 steps · unrated
Perform bulk table ingestion using ADBC in Python
arrow.apache.org · 5 steps · unrated
Maintain read-your-writes consistency in a Dataverse elastic table using session tokens
learn.microsoft.com · 4 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