Skip to content

Commit e1a700d

Browse files
committed
fix : Handle NoneType error when fineGrainedLineages is missing
1 parent f149d4c commit e1a700d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

data_utils/datahub_source.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ def get_column_lineage(self, urn):
168168
# upstream_dataset별로 column lineage
169169
upstream_map = defaultdict(list)
170170

171-
for fg in result.fineGrainedLineages:
171+
for fg in result.fineGrainedLineages or []:
172+
confidence_score = (
173+
fg.confidenceScore if fg.confidenceScore is not None else 1.0
174+
)
172175
for down in fg.downstreams:
173176
down_column = down.split(",")[-1].replace(")", "")
174177
for up in fg.upstreams:
@@ -177,7 +180,11 @@ def get_column_lineage(self, urn):
177180
up_column = up.split(",")[-1].replace(")", "")
178181

179182
upstream_map[up_dataset].append(
180-
{"upstream_column": up_column, "downstream_column": down_column}
183+
{
184+
"upstream_column": up_column,
185+
"downstream_column": down_column,
186+
"confidence": confidence_score,
187+
}
181188
)
182189

183190
# 최종 결과 구조 생성

0 commit comments

Comments
 (0)