Repository navigation
Fixes 37077: Hex lineage links source tables to the data model, not dashboard - #37078
Conversation
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.
A shard name such as events_20260101 misses the exact lookup by design; the family resolves it without a search request.
…ta 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.
…ames - 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.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
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.
…othing 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.
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Redirecting Hex lineage to data models and adding case-insensitive BigQuery resolution could misattribute source tables or omit lineage when names are ambiguous. Hex lineage now links source tables to the project's data model instead of the dashboard, and BigQuery case-insensitive references resolve to their single match. A data model with no columns that a deleted SQL cell had created is now removed correctly. No open issues found. ✅ 1 closed✅ Edge Case: Columnless data model from a deleted SQL cell is never removed
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
…ashboard (#37078) (#37166) * 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)



Describe your changes:
Fixes #37077
Hex dashboards showed source tables wired straight to the dashboard, several of them tables the project never reads. Tables found only in the warehouse query history were linked to the dashboard instead of the data model. And because
LineageParserlower-cases names, a BigQuerycrm.Accountmissed its exact lookup and fell back to everyaccounttable in the project. Every Hex table edge now goes to the project's data model, query-history edges at node level only. A reference that names a schema never leaves it, and a lower-cased BigQuery name resolves to its single case-insensitive match.Type of change:
High-level design:
hex/metadata.py):_lineage_targetreturns the data model while data models are on, and the dashboard only when they are off or the project's data model is filtered out. Cell edges (with column lineage) and query-history edges (without, since history can't say which cell read the table) both use it.hex/query_fetcher.py): asks for the schema-less fallback only on a bare table name, and drops a bare name that matches several tables, as cells already do. The sharedget_table_entities_from_queryis untouched, since Dremio/Postgres view lineage relies on its fallback.bigquery/resolution.py): a scoped reference that misses its exact name and any shard family takes the one case-insensitive match, none when several match (BigQuery names are case-sensitive). This applies to every scoped BigQuery lookup, not only Hex.ADR:2026-10-27-hex-project-is-one-data-model-with-a-column-group-per-cell-id(v3) andADR:2026-11-03-bigquery-daily-shards-use-stable-logical-tables(v2).static_cell_ideach Hex query carries, to give those edges column lineage.Tests:
Use cases covered
Unit tests
tests/unit/topology/dashboard/test_hex_cell_lineage.py,tests/unit/entity_resolution/test_resolver.py,tests/unit/topology/dashboard/test_hex_ingestion_flow.py(pinned toincludeDataModels: falseto keep exercising the dashboard path).tests/unit/topology/dashboard: 1738 passed, 1 skipped.tests/unit/utils,entity_resolution,lineage,topology): 7077 passed. The 3 failures intopology/pipeline/test_airflow_connection.pycome from my local Airflow config (No module named 'cwl_airflow') and are unrelated.hex/metadata.py93%,bigquery/resolution.py96%,hex/query_fetcher.py80%. The fetcher's warehouse-connection code is only reached by integration tests.Backend integration tests
Ingestion integration tests
tests/integration/ometa/test_hex_sharding_search.py, which the merge queue runs.Playwright (UI) tests
Manual testing performed
UI screen recording:
Not applicable — ingestion-only bug fix.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed. (No schema changes.)
For a UI feature or feature task: Docker build + recording. (Not applicable, no UI.)
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.7d6bc3e0089, no 🔴. Earlier passes found four, all fixed: a Dremio view-lineage regression from changing the shared helper; lineage dropped for projects without a data model; a column-less data model deleted after the history window; and the same deleted when its lookup fails. The local test run also caught the case-insensitive search preempting the shard-family lookup, fixed too.Decision check: amends
ADR:2026-10-27-hex-project-is-one-data-model-with-a-column-group-per-cell-id(v3) andADR:2026-11-03-bigquery-daily-shards-use-stable-logical-tables(v2).I have added a test that covers the exact scenario we are fixing.