Repository navigation
Fixes 36357: Hex cells reading a broken cell keep their data model groups - #36541
Conversation
A cell whose SQL fails keeps its existing group, but the cells reading its result lost theirs: dataframe SQL over it was dropped and a warehouse cell searched its name as a table, coming back with UNKNOWN columns. A cell reading a failed cell now fails too, down the chain, so each keeps its group.
❌ 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 |
Code Review ✅ Approved🟡 Medium risk · Tracking failed Hex SQL cells makes dependents retain prior column groups instead of rebuilding; stale schemas or lineage could persist while parsing is broken. Hex cells that read a broken cell now keep their data model groups, covering dataframe SQL and same-connection warehouse cells, including chained cells downstream. Failure tracking clears when a later cell redefines the name. No issues found. 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 |
|
…(2.0) (#36388) * Fixes 36357: Hex data models and column-level lineage from project SQL cells (2.0) Backport of #36371 to 2.0, squashed from 33b47d3, 16ad476, 22d96d4, 6af0b43, 791ff4a, c42a857, cacf30b, c5d461c, 61debe6, 05f7d5c and d996669. Adapted to 2.0: - es_search_from_fqn has no raise_on_error here and returns None for a failed search, so the Hex source runs the FQN search itself and treats a search that didn't answer as an error, not as "no such table". - The project's tag handling (tag_utils) is kept as it is on 2.0. - The decision record is not added: 2.0 has no docs/decisions. The code cites ADR:2026-10-27-hex-project-is-one-data-model-with-a-column-group-per-cell-id on main. * Hex: keep models without data connections, keep broken cells' groups - Data connections the token can't read raise HexAccessDeniedError and are asked for once per run. Without them an existing data model is left as it is instead of being rebuilt without dialects and connection defaults; only a project without one gets one. - A cell whose SQL fails to parse keeps its column group from the existing data model, with what users curated on it. - A column name is parsed out of the lineage leaf rather than split on dots, so a quoted "customer.id" is one name. - A column passed straight through keeps its table column's array element type, display type and nested fields. (cherry picked from commit a6b8920) * Hex (2.0): a failed read of a table the search found keeps the data model The 2.0 FQN search reads each table it finds; an error there now counts as a failed search, so the project's existing data model is kept rather than rebuilt without that cell. * Hex: keep a kept data model linked, copy only the type of passed-through columns - A data model kept because its existing groups couldn't be read stays linked to the dashboard: the data model stage records what it kept and the dashboard stage links it, instead of only when the cells couldn't be read. - A passed-through struct's fields copy only the table column's type, not its description, tags, constraint or profile. (cherry picked from commit c02d176) * Hex: a data model without a dashboard URL is still ingested; HexDataModel in the generated types Matches the resolution on main (#36371) of the data model sourceUrl against the workspace-scoped Hex URLs, which return None when the workspace id can't be read. The generated TypeScript enum value is the one #36371 generated on main; the type-generation workflow fails on 2.0 so it never added it here. * Hex: cells reading a broken cell keep their data model groups A cell whose SQL fails keeps its existing group, but the cells reading its result lost theirs: dataframe SQL over it was dropped and a warehouse cell searched its name as a table, coming back with UNKNOWN columns. A cell reading a failed cell now fails too, down the chain, so each keeps its group. (cherry picked from commit ea7e122) * Hex: add the data model decision record the code cites 2.0 now has docs/decisions/, so the record #36371 added on main (with its v2 amendment from #36541) comes along instead of leaving the ADR citation in hex/metadata.py dangling.



Describe your changes:
Fixes #36357
Follow-up to #36371, from Gitar's review of its 2.0 backport (#36388). A cell whose SQL stops parsing (a draft being edited) keeps its column group, but the cells reading its result did not:
UNKNOWNcolumns and no lineage.Now
ChainedCellsrecords a failed cell's result variable, using the same connection rules as chaining: same connection, or any for dataframe SQL. A cell that reads a failed cell fails too, and so on down the chain, so each one keeps its group from the existing data model. A successful cell that later reuses the name clears the failure. The ADR gets a v2 amendment stating the rule.Type of change:
High-level design:
N/A — small change (3 code/test files plus the ADR amendment).
Tests:
Use cases covered
UNKNOWN.Unit tests
test_cells_reading_a_broken_cell_keep_their_groups(dataframe SQL and same-connection variants, three-cell chain) andtest_a_failed_cell_is_failed_only_for_the_cells_that_can_read_itiningestion/tests/unit/topology/dashboard/test_hex_cell_lineage.py.mainwithout the fix: the group is dropped (['c1']) for dataframe SQL, and the column isUNKNOWNfor the same connection.addreset, or the connection filter each makes a new test fail.PYTHONPATH=src python -m pytest tests/unit/topology/dashboard/test_hex*.py tests/unit/source/dashboard/hex→ 157 passed.ruff check/ruff format --checkclean;basedpyrightonhex/→ 0 errors.Backend integration tests
Ingestion integration tests
tests/integration/suite; every test importing the changed modules is listed above.Playwright (UI) tests
Manual testing performed
Not run against a live Hex workspace; the unit tests reproduce the export shapes (chained dataframe and warehouse SQL cells over a broken cell) end to end through the data model stage.
UI screen recording:
Not applicable — ingestion connector fix, no UI code.
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: not applicable, no schema change.
For a UI feature or feature task: not applicable.
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.2209cc21a68: no 🔴. Fixed all three 🟡 inea7e12238d1: a redefined name now clears its failure, a test covers the connection filter, and the warning names the failed cell being read.Decision check:
ADR:2026-10-27-hex-project-is-one-data-model-with-a-column-group-per-cell-idgets a v2 amendment for this rule.I have added a test that covers the exact scenario we are fixing.
Backports: #36387 (2.1) and #36388 (2.0) carry this commit too.
🤖 Generated with Claude Code