Skip to main content

bq-v2-field-paths

A DataHub ingestion transformer that makes column-level lineage resolve through nested BigQuery RECORD columns.

The problem

DataHub's BigQuery source spells a nested column two different ways:

  • its schema generator writes v2 paths into schemaMetadata — [version=2.0].[type=struct].[type=struct].payload.[type=long].amount
  • its SQL parser names the same column payload.amount, and that name goes straight into the schemaField URN of every fine-grained lineage edge

Because DataHub resolves a schemaField URN by exact string match against the entity's current schemaMetadata, every column edge touching a RECORD column points at a field path that does not exist, and the UI silently draws nothing. Flat scalar columns render only because their two spellings coincide.

The mapping is not in doubt — the SQL parser derives it correctly, even through expressions. Only the spelling is wrong. This transformer rewrites it.

For a table whose real columns all live inside one RECORD — anything landed by Debezium CDC, for instance — that is the difference between no column lineage and complete column lineage.

Usage

transformers:
  - type: "bq_v2_field_paths"
    config: {}

transformers is a top-level key in the recipe, a sibling of source.

Anything it cannot map with certainty is left untouched: a dataset whose schema it cannot find, or two v2 paths that reduce to the same simplified name. It logs a one-line summary at end of stream saying how many URNs it rewrote, how many were already valid, and how many it skipped.

Config

key default meaning
platform bigquery only rewrite URNs on this data platform
use_graph_fallback true look schemas up in DataHub when not seen in the stream
expand_struct_parents true creates lineage: see below
max_unmapped_logged 20 cap on distinct unmapped columns named in the summary

expand_struct_parents

Every other setting only ever rewrites an edge the SQL parser already derived. This one is the exception: it emits new edges, and it is on by default.

Where a query projects a struct wholesale, the parser emits after_row <- after_row and nothing for the fields inside it. Rewriting that edge makes it resolve, but clicking a child column still shows nothing. So for such an edge, one edge is emitted per child whose identically-named counterpart exists on both sides' schemaMetadata — a fact read off two schemas, never a guess. Nesting is followed all the way down, so after_row.addr.city is expanded, not just after_row.addr.

Set it to false for parent-level edges only, which for a struct-shaped table amounts to no usable column lineage.

Requirements

Needs an executor on acryl-datahub 1.6 or newer, which is where pydantic>=2.4 is pinned. dependencies is deliberately empty so that installing this package can never resolve or upgrade the executor's own acryl-datahub — the trade is that the floor is documented here rather than enforced by pip.

Metadata

Release files for bq-v2-field-paths 0.3.0

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

Source distribution (sdist)

Source distribution for bq-v2-field-paths 0.3.0
File Size Uploaded Provenance Actions
bq_v2_field_paths-0.3.0.tar.gz 16.6 kB Without provenance Details for bq_v2_field_paths-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bq-v2-field-paths 0.3.0
File Interpreter ABI Platform Actions
bq_v2_field_paths-0.3.0-py3-none-any.whl Python 3 none any Details for bq_v2_field_paths-0.3.0-py3-none-any.whl

Total release size: 29.8 kB

Release files / bq_v2_field_paths-0.3.0.tar.gz

Download URL bq_v2_field_paths-0.3.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a6d2ea8af677a24b3bce56307712ecac46b22d13fa1eb21e180e187fc84a390c
BLAKE2b-256 checksum
How to use checksums
92b26e12385d4597cef4df1add88d5af011d0eb58a19c79105ea44eb0f34b223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bq_v2_field_paths-0.3.0-py3-none-any.whl

Download URL bq_v2_field_paths-0.3.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6953bf07bd704cf022c951c9aa4f86480302b56d0df19dd5e290d99dd30eed2
BLAKE2b-256 checksum
How to use checksums
d6a5c1a038ef6b5a9eaa1f2b5df769ca58c0721f9b809d46554e9f8c49c8be62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bq-v2-field-paths 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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