From afd9ed03f2b6489d34e58f37a3b7c4085f2f1ed9 Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:24:46 +0530 Subject: [PATCH] MINOR: Implement column validation in lineage patch api (#20545) --- ingestion/tests/integration/ometa/test_ometa_lineage_api.py | 4 ++-- .../org/openmetadata/service/jdbi3/LineageRepository.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ingestion/tests/integration/ometa/test_ometa_lineage_api.py b/ingestion/tests/integration/ometa/test_ometa_lineage_api.py index f083a50f6cc..7442adf459a 100644 --- a/ingestion/tests/integration/ometa/test_ometa_lineage_api.py +++ b/ingestion/tests/integration/ometa/test_ometa_lineage_api.py @@ -267,9 +267,9 @@ class OMetaLineageTest(TestCase): columnsLineage=[ ColumnLineage( 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", ) ], ), diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java index ee25ab0ed9b..29c81707c14 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java @@ -790,7 +790,9 @@ public class LineageRepository { pipeline.getType(), pipeline.getId(), Include.NON_DELETED); updated.withPipeline(pipeline); } - String detailsJson = JsonUtils.pojoToJson(updated); + + // Validate Lineage Details + String detailsJson = validateLineageDetails(from, to, updated); dao.relationshipDAO() .insert(fromId, toId, fromEntity, toEntity, Relationship.UPSTREAM.ordinal(), detailsJson); addLineageToSearch(from, to, updated);