Skip to content

Fix dbt CTE and output node collisions - #16

Merged
melonamin merged 3 commits into
masterfrom
fix/issue-15-dbt-ctes-output
Apr 8, 2026
Merged

melonamin merged 3 commits into
masterfrom
fix/issue-15-dbt-ctes-output

Conversation

@melonamin

@melonamin melonamin commented Mar 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • scope CTE and derived-table nodes to the statement so same-named dbt model internals do not collapse together
  • keep CTE nodes statement-local in global lineage and render every explicit output node in merged graph views
  • add Rust and React regressions covering repeated dbt CTE names and multiple output nodes

Sample

Shared link

Testing

  • cargo test -p flowscope-core repeated_cte_aliases_across_statements_keep_distinct_global_instance_nodes --quiet
  • cargo test -p flowscope-core dbt_same_named_ctes_in_different_models_stay_distinct --features templating --quiet
  • yarn workspace @pondpilot/flowscope-react test graphBuilders.test.ts
  • yarn workspace @pondpilot/flowscope-react typecheck

Screenshot

Before
Screenshot 2026-03-31 at 14 47 26
After
image

Closes #15

Extract duplicated output-column grouping, output-mapping resolution,
and edge-pair keying logic from graphBuilders.ts and the web worker
into shared functions in lineageHelpers.ts. Use a null-separated
edge pair key to prevent ID substring collisions. Add clarifying
doc comments to Rust CTE scoping logic and reformat codegen outputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The dbt project have some error

1 participant