Skip to content

fix(json): retain node identities with custom entity names - #163

Merged
datnguye merged 1 commit into
datnguye:mainfrom
dajiaohuang:fix/json-node-identities-20261016
Oct 19, 2026
Merged

datnguye merged 1 commit into
datnguye:mainfrom
dajiaohuang:fix/json-node-identities-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Resolves #159

Description

Resolve relationship display names to emitted node IDs at the JSON target boundary, before collecting FK flags or formatting edges. This preserves short/custom node names without dangling edge IDs or missing FK column flags, and leaves shared input relationships unchanged.

Validated with public DbtErd(artifacts_dir=..., target="json", entity_name_format="table").get_erd() on entirely authored tiny manifest v12/catalog v1 artifacts: both edge endpoints resolve to emitted nodes, customer_id is flagged, and the JSON schema passes. The regression fails on the base and passes with this change.

Checks: complete unit suite 575 passed (7 existing Click deprecation warnings); changed-file Ruff lint/format and git diff --check pass. Python 3.13 on Windows. No live dbt, database, Cloud API, or downstream editor acceptance testing. CI results are not claimed.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests
  • Docs changes are not required for this correction of the documented node-ID contract

@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e7783aa) to head (f60bb6e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #163      +/-   ##
===========================================
+ Coverage   99.90%   100.00%   +0.09%     
===========================================
  Files          45        45              
  Lines        2163      2166       +3     
===========================================
+ Hits         2161      2166       +5     
+ Misses          2         0       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datnguye
datnguye merged commit 6b5eca6 into datnguye:main Oct 19, 2026
15 checks passed
@datnguye

Copy link
Copy Markdown
Owner

LGTM thanks @dajiaohuang

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.

JSON custom entity names leave dangling edge IDs and lose FK flags

2 participants