Skip to content

Commit c041c1a

Browse files
committed
sources have identifiers, not models.
1 parent adeba32 commit c041c1a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/dbt_mcp/dbt_cli/models/lineage_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ def get_uid_from_name(manifest: dict[str, Any], model_id: str) -> str:
127127
return model_id
128128
# fallback: look through eveything for the identifier
129129
for uid, node in manifest.get("nodes", {}).items():
130-
if node.get("identifier") == model_id:
130+
if node.get("name") == model_id:
131131
return uid
132132
for uid, source in manifest.get("sources", {}).items():
133-
if source.get("name") == model_id:
133+
if source.get("identifier") == model_id:
134134
return uid
135135
for uid, exposure in manifest.get("exposures", {}).items():
136136
if exposure.get("name") == model_id:

tests/unit/dbt_cli/test_model_lineage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ def sample_manifest():
2121
"source.1": [],
2222
},
2323
"nodes": {
24-
"model.a": {"identifier": "a"},
25-
"model.b": {"identifier": "b"},
26-
"model.c": {"identifier": "c"},
27-
"model.d": {"identifier": "d"},
24+
"model.a": {"name": "a"},
25+
"model.b": {"name": "b"},
26+
"model.c": {"name": "c"},
27+
"model.d": {"name": "d"},
2828
},
2929
"sources": {
30-
"source.1": {"name": "1"},
30+
"source.1": {"identifier": "1"},
3131
},
3232
"exposures": {
3333
"exposure.1": {"name": "1"},

0 commit comments

Comments
 (0)