(cherry picked from commit 4a611ea69061bbb2783b2794c2d21de1716c5408)
This commit is contained in:
Mohit Yadav 2025-04-30 00:49:00 +05:30 committed by mohitdeuex
parent c8c0fa5e70
commit c4b928ceec

View File

@ -15,6 +15,7 @@ package org.openmetadata.service.jdbi3;
import static javax.ws.rs.core.Response.Status.OK; import static javax.ws.rs.core.Response.Status.OK;
import static org.openmetadata.common.utils.CommonUtil.collectionOrDefault; import static org.openmetadata.common.utils.CommonUtil.collectionOrDefault;
import static org.openmetadata.common.utils.CommonUtil.listOrEmpty;
import static org.openmetadata.common.utils.CommonUtil.nullOrDefault; import static org.openmetadata.common.utils.CommonUtil.nullOrDefault;
import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty; import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty;
import static org.openmetadata.csv.CsvUtil.addField; import static org.openmetadata.csv.CsvUtil.addField;
@ -834,6 +835,9 @@ public class LineageRepository {
case CONTAINER -> { case CONTAINER -> {
Container container = Container container =
Entity.getEntity(CONTAINER, entityReference.getId(), "dataModel", Include.NON_DELETED); Entity.getEntity(CONTAINER, entityReference.getId(), "dataModel", Include.NON_DELETED);
if (container.getDataModel() == null || container.getDataModel().getColumns() == null) {
return new HashSet<>();
}
return CommonUtil.getChildrenNames( return CommonUtil.getChildrenNames(
container.getDataModel().getColumns(), container.getDataModel().getColumns(),
"getChildren", "getChildren",
@ -852,7 +856,7 @@ public class LineageRepository {
Dashboard dashboard = Dashboard dashboard =
Entity.getEntity(DASHBOARD, entityReference.getId(), "charts", Include.NON_DELETED); Entity.getEntity(DASHBOARD, entityReference.getId(), "charts", Include.NON_DELETED);
Set<String> result = new HashSet<>(); Set<String> result = new HashSet<>();
for (EntityReference chart : dashboard.getCharts()) { for (EntityReference chart : listOrEmpty(dashboard.getCharts())) {
result.add( result.add(
chart.getFullyQualifiedName().replace(dashboard.getFullyQualifiedName() + ".", "")); chart.getFullyQualifiedName().replace(dashboard.getFullyQualifiedName() + ".", ""));
} }
@ -862,7 +866,7 @@ public class LineageRepository {
MlModel mlModel = MlModel mlModel =
Entity.getEntity(MLMODEL, entityReference.getId(), "", Include.NON_DELETED); Entity.getEntity(MLMODEL, entityReference.getId(), "", Include.NON_DELETED);
Set<String> result = new HashSet<>(); Set<String> result = new HashSet<>();
for (MlFeature feature : mlModel.getMlFeatures()) { for (MlFeature feature : listOrEmpty(mlModel.getMlFeatures())) {
result.add( result.add(
feature.getFullyQualifiedName().replace(mlModel.getFullyQualifiedName() + ".", "")); feature.getFullyQualifiedName().replace(mlModel.getFullyQualifiedName() + ".", ""));
} }