Skip to content

Commit 909289a

Browse files
committed
fix : Handle split index error in get_column_lineage URN parsing
1 parent c31166d commit 909289a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

data_utils/datahub_source.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,21 @@ def get_column_lineage(self, urn):
162162
result = graph.get_aspect(entity_urn=urn, aspect_type=UpstreamLineageClass)
163163

164164
# downstream dataset (URN 테이블명) 파싱
165-
down_dataset = urn.split(",")[1]
166-
table_name = down_dataset.split(".")[1]
165+
try:
166+
down_dataset = urn.split(",")[1]
167+
table_name = down_dataset.split(".")[1]
168+
169+
except IndexError:
170+
# URN이 유효하지 않는 경우
171+
print(f"[ERROR] Invalid URN format: {urn}")
172+
return {}
167173

168174
# upstream_dataset별로 column lineage
169175
upstream_map = defaultdict(list)
170176

177+
if not result:
178+
return {"downstream_dataset": table_name, "lineage_by_upstream_dataset": []}
179+
171180
for fg in result.fineGrainedLineages or []:
172181
confidence_score = (
173182
fg.confidenceScore if fg.confidenceScore is not None else 1.0

0 commit comments

Comments
 (0)