MINOR: Implement column validation in lineage patch api (#20545)

This commit is contained in:
Mayur Singal 2025-04-07 21:24:46 +05:30 committed by GitHub
parent 3186937cc2
commit 4a407f6d0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -267,9 +267,9 @@ class OMetaLineageTest(TestCase):
columnsLineage=[ columnsLineage=[
ColumnLineage( ColumnLineage(
fromColumns=[ fromColumns=[
f"{self.table1_entity.fullyQualifiedName.root}.name" f"{self.table1_entity.fullyQualifiedName.root}.another"
], ],
toColumn=f"{self.table2_entity.fullyQualifiedName.root}.name", toColumn=f"{self.table2_entity.fullyQualifiedName.root}.another",
) )
], ],
), ),

View File

@ -1146,7 +1146,8 @@ public class LineageRepository {
updated.setUpdatedAt(System.currentTimeMillis()); updated.setUpdatedAt(System.currentTimeMillis());
updated.setUpdatedBy(updatedBy); updated.setUpdatedBy(updatedBy);
String detailsJson = JsonUtils.pojoToJson(updated); // Validate Lineage Details
String detailsJson = validateLineageDetails(from, to, updated);
dao.relationshipDAO() dao.relationshipDAO()
.insert(fromId, toId, fromEntity, toEntity, Relationship.UPSTREAM.ordinal(), detailsJson); .insert(fromId, toId, fromEntity, toEntity, Relationship.UPSTREAM.ordinal(), detailsJson);
addLineageToSearch(from, to, updated); addLineageToSearch(from, to, updated);