Skip to content

Commit f9c8ca8

Browse files
Merge pull request #30 from Breeding-Insight/helium-integration
BI-2100 - BrAPI Hackathon Integration of Helium with DeltaBreed
2 parents 24dbf87 + aaf7fbd commit f9c8ca8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/org/brapi/test/BrAPITestServer/service/germ/PedigreeService.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,14 @@ private List<PedigreeNodeEntity> filterGenerations(PedigreeSearchRequest request
339339
progenyDepth = Integer.MAX_VALUE;
340340
}
341341

342-
Set<PedigreeNodeEntity> baseNodesSet = new HashSet<>(baseNodes);
343-
Set<PedigreeNodeEntity> pedigreeTree = new HashSet<>(baseNodes);
342+
// TODO: Should the pedigree node records written to the db be different? Converting to a hashset keeps
343+
// an entry for records with null germplasm which is not desired in output. Filtering out here for now.
344+
List<PedigreeNodeEntity> filteredBaseNodes = baseNodes.stream()
345+
.filter(node -> node.getGermplasm() != null)
346+
.collect(Collectors.toList());
347+
348+
Set<PedigreeNodeEntity> baseNodesSet = new HashSet<>(filteredBaseNodes);
349+
Set<PedigreeNodeEntity> pedigreeTree = new HashSet<>(filteredBaseNodes);
344350

345351
getGenerationsRecursively(baseNodesSet, pedigreeDepth, true, pedigreeTree);
346352
getGenerationsRecursively(baseNodesSet, progenyDepth, false, pedigreeTree);

0 commit comments

Comments
 (0)