Skip to content

[2.0] Fixes 37077: Hex lineage links source tables to the data model, not dashboard - #37166

Merged
ulixius9 merged 1 commit into
2.0from
ulixius9/backport-37078-2.0
Nov 5, 2026
Merged

ulixius9 merged 1 commit into
2.0from
ulixius9/backport-37078-2.0

Conversation

@ulixius9

@ulixius9 ulixius9 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Backport of #37078 to 2.0. Fixes #37077.

Cherry-picked with -x from 75b1bbd.

Conflict resolution

  • ingestion/.ruff-g004-baseline.json doesn't exist on 2.0. The original commit only pruned entries from it, so I dropped that file from the backport. Every other file applied cleanly.

Verification (on the 2.0 base, with models regenerated from 2.0's schemas)

  • pytest tests/unit/entity_resolution/test_resolver.py tests/unit/topology/dashboard/test_hex*.py: 325 passed
  • ruff check / ruff format --check on the changed Python files: clean

🤖 Generated with Claude Code


Summary by Gitar

  • Lineage targets:
    • Hex tables now link to the data model rather than the dashboard, with column lineage where cells resolve
    • Tables named only by query history link to the data model without column lineage
  • Data model handling:
    • Columnless data models are created when tables need linking and kept when query history lapses
  • Query history resolution:
    • Schema-qualified references resolve only in their schema; bare names link only when one table matches
  • BigQuery resolution:
    • Missed scoped names take their single case-insensitive variant

This will update automatically on new commits.

…ashboard (#37078)

* fix(hex): link source tables to the data model, never the dashboard

Tables only the warehouse query history names now link to the project's
data model at node level instead of straight to the dashboard. A project
whose cells give no columns still gets a data model when the query history
names tables for it.

The query-history lookup no longer drops a schema the query names, and
BigQuery resolution retries a missed exact name case-insensitively, taking
only a single match: LineageParser lower-cases Account to account, which
used to fall back to every same-named table in the database.

* fix(bigquery): try a shard family before a case variant

A shard name such as events_20260101 misses the exact lookup by design;
the family resolves it without a search request.

* fix(hex): keep the query-history schema rule to Hex, give tables a data model

Address self-review findings:
- Leave get_table_entities_from_query as it was: Dremio view lineage relies on
  its schema fallback for nested folders. The Hex query fetcher now only asks
  for the fallback on a bare table name.
- A project with tables to link but no columns (unreadable cells, or cells
  that read tables yet output none) gets a data model without columns, so its
  lineage isn't dropped.
- Keep a data model without columns when this run finds no tables for it: the
  query history only looks back seven days.

* fix(hex): keep a data model whose lookup fails, skip ambiguous bare names

- A data model without columns whose lookup fails is kept rather than
  deleted with its lineage.
- A bare name in the query history that matches several tables links none,
  as for cells.
- Record the BigQuery case-insensitive retry in its own decision record.

* chore(hex): prune G004 baseline entries for removed log calls

* fix(hex): only keep a column-less data model built from query history

A column-less data model with SQL came from cells, which are read each
run; keeping it after they are deleted left it and its lineage behind.

* fix(hex): keep a query-history data model beside cells that resolve nothing

A data model only the query history fills was saved with the SQL of
cells that read no resolvable table, so once its tables left the
history's lookback window it looked built from cells and was deleted
with its lineage. Write SQL only when the cells gave the data model
columns or tables.

* fix(hex): apply the prefix filter before judging a bare name ambiguous

(cherry picked from commit 75b1bbd)
@ulixius9
ulixius9 requested a review from a team as a code owner November 5, 2026 13:32
@ulixius9 ulixius9 added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Nov 5, 2026
@ulixius9
ulixius9 requested review from mohittilala and removed request for a team November 5, 2026 13:32
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Routing Hex lineage to data models and changing table resolution could misattribute or omit upstream table relationships.

Backport of the Hex lineage fix to 2.0, so Hex tables link to the data model rather than the dashboard, with column lineage where cells resolve. Query-history-only tables link to the data model without column lineage, and data models are created columnless when needed. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants