Skip to content

Commit

Permalink
Return orphan graph on failed lookup for job when dataset nodeID prov…
Browse files Browse the repository at this point in the history
…ided

Signed-off-by: wslulciuc <willy@datakin.com>
  • Loading branch information
wslulciuc committed Dec 12, 2022
1 parent 5e4aeea commit 5cd3207
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/src/main/java/marquez/service/LineageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public Lineage lineage(NodeId nodeId, int depth, boolean withRunFacets) {
log.debug("Attempting to get lineage for node '{}' with depth '{}'", nodeId.getValue(), depth);
Optional<UUID> optionalUUID = getJobUuid(nodeId);
if (optionalUUID.isEmpty()) {
throw new NodeIdNotFoundException(String.format("Node '%s' not found!", nodeId.getValue()));
log.warn(
"Failed to get job associated with node '{}', returning orphan graph...",
nodeId.getValue());
return toLineageWithOrphanDataset(nodeId.asDatasetId());
}
UUID job = optionalUUID.get();
log.debug("Attempting to get lineage for job '{}'", job);
Expand Down Expand Up @@ -99,7 +102,7 @@ public Lineage lineage(NodeId nodeId, int depth, boolean withRunFacets) {
if (nodeId.isDatasetType()
&& datasets.stream().noneMatch(n -> n.getId().equals(nodeId.asDatasetId()))) {
log.warn(
"Found jobs '{}' which no longer share lineage with dataset '{}' - discarding",
"Found jobs {} which no longer share lineage with dataset '{}' - discarding",
jobData.stream().map(JobData::getId).toList(),
nodeId.getValue());
return toLineageWithOrphanDataset(nodeId.asDatasetId());
Expand Down

0 comments on commit 5cd3207

Please sign in to comment.