Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lineage): fix missed casing in lineage registry #6078

Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -57,14 +57,14 @@ private Map<String, LineageSpec> buildLineageSpecs(EntityRegistry entityRegistry
for (LineageEdge edge : lineageEdges) {
if (edge.isUpstream()) {
upstreamPerEntity.computeIfAbsent(edge.sourceEntity.toLowerCase(), (k) -> new HashSet<>())
.add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING, edge.destEntity));
.add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING, edge.destEntity.toLowerCase()));
downstreamPerEntity.computeIfAbsent(edge.destEntity.toLowerCase(), (k) -> new HashSet<>())
.add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING, edge.sourceEntity));
.add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING, edge.sourceEntity.toLowerCase()));
} else {
downstreamPerEntity.computeIfAbsent(edge.sourceEntity.toLowerCase(), (k) -> new HashSet<>())
.add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING, edge.destEntity));
.add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING, edge.destEntity.toLowerCase()));
upstreamPerEntity.computeIfAbsent(edge.destEntity.toLowerCase(), (k) -> new HashSet<>())
.add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING, edge.sourceEntity));
.add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING, edge.sourceEntity.toLowerCase()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public void testRegistry() {
assertTrue(lineageSpec.getUpstreamEdges()
.contains(new LineageRegistry.EdgeInfo("DownstreamOf", RelationshipDirection.OUTGOING, "dataset")));
assertTrue(lineageSpec.getUpstreamEdges()
.contains(new LineageRegistry.EdgeInfo("Produces", RelationshipDirection.INCOMING, "dataJob")));
.contains(new LineageRegistry.EdgeInfo("Produces", RelationshipDirection.INCOMING, "datajob")));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Waitttt are the edges really having lower case?

assertEquals(lineageSpec.getDownstreamEdges().size(), 2);
assertTrue(lineageSpec.getDownstreamEdges()
.contains(new LineageRegistry.EdgeInfo("DownstreamOf", RelationshipDirection.INCOMING, "dataset")));
assertTrue(lineageSpec.getDownstreamEdges()
.contains(new LineageRegistry.EdgeInfo("Consumes", RelationshipDirection.INCOMING, "dataJob")));
.contains(new LineageRegistry.EdgeInfo("Consumes", RelationshipDirection.INCOMING, "datajob")));
}

private RelationshipFieldSpec buildSpec(String relationshipType, List<String> destinationEntityTypes,
Expand Down