Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -452,22 +452,24 @@ public static void addPipelineDetails(EsLineageData lineageData, EntityReference
if (nullOrEmpty(pipelineRef)) {
lineageData.setPipeline(null);
} else {
Pair<String, Map<String, Object>> pipelineOrStoredProcedure =
getPipelineOrStoredProcedure(
pipelineRef, List.of("changeDescription", "incrementalChangeDescription"));
lineageData.setPipelineEntityType(pipelineOrStoredProcedure.getLeft());
lineageData.setPipeline(pipelineOrStoredProcedure.getRight());
try {
Pair<String, Map<String, Object>> pipelineOrStoredProcedure =
getPipelineOrStoredProcedure(
pipelineRef, List.of("changeDescription", "incrementalChangeDescription"));
lineageData.setPipelineEntityType(pipelineOrStoredProcedure.getLeft());
lineageData.setPipeline(pipelineOrStoredProcedure.getRight());
} catch (Exception ex) {
LOG.warn("Failed to get pipeline details for elastic search mapping", ex);
lineageData.setPipelineEntityType(pipelineRef.getType());
lineageData.setPipeline(JsonUtils.getMap(pipelineRef));
}
}
}
}

public static Pair<String, Map<String, Object>> getPipelineOrStoredProcedure(
EntityReference pipelineRef, List<String> fieldsToRemove) {
Map<String, Object> pipelineMap;
if (pipelineRef.getType().equals(PIPELINE)) {
pipelineMap =
JsonUtils.getMap(
Entity.getEntity(pipelineRef, "pipelineStatus,tags,owners", Include.ALL));
} else {
public static Pair<String, Map<String, Object>> getPipelineOrStoredProcedure(
EntityReference pipelineRef, List<String> fieldsToRemove) {
Map<String, Object> pipelineMap;
if (pipelineRef.getType().equalsIgnoreCase(Entity.PIPELINE)) {
pipelineMap = JsonUtils.getMap(Entity.getEntity(pipelineRef, "tags,owners", Include.ALL));
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ const AddPipeLineModal = ({
pageSize: PAGE_SIZE,
searchIndex: [SearchIndex.PIPELINE, SearchIndex.STORED_PROCEDURE],
});
const edgeOptions = data.hits.hits.map((hit) =>
getEntityReferenceFromEntity(
const edgeOptions = data.hits.hits.map((hit) => {
const entityType = hit._source.entityType || (hit._index.includes('pipeline') ? EntityType.PIPELINE : EntityType.STORED_PROCEDURE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Pipeline type fallback relies on fragile index name check

When hit._source.entityType is missing, the fallback hit._index.includes('pipeline') depends on the Elasticsearch/OpenSearch index naming convention. If the index name changes (e.g., versioned indices like pipeline_search_index_v2, or aliased differently), this heuristic could misclassify entities. This is a reasonable workaround for the immediate bug, but is fragile for long-term maintenance.

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

return getEntityReferenceFromEntity(
hit._source,
hit._source.entityType as EntityType
)
);
entityType as EntityType
);
});

setEdgeOptions(edgeOptions);
} catch (error) {
Expand Down
Loading