-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
chore() Set a default lineage filtering end time on backend when a start time is present #10925
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,6 +6,7 @@ | |||||||||||||||||||||||||||||
import com.linkedin.datahub.graphql.QueryContext; | ||||||||||||||||||||||||||||||
import com.linkedin.datahub.graphql.generated.EntityTypeToPlatforms; | ||||||||||||||||||||||||||||||
import com.linkedin.datahub.graphql.generated.LineageFlags; | ||||||||||||||||||||||||||||||
import com.linkedin.datahub.graphql.resolvers.ResolverUtils; | ||||||||||||||||||||||||||||||
import com.linkedin.datahub.graphql.types.entitytype.EntityTypeMapper; | ||||||||||||||||||||||||||||||
import com.linkedin.datahub.graphql.types.mappers.ModelMapper; | ||||||||||||||||||||||||||||||
import java.util.Collections; | ||||||||||||||||||||||||||||||
|
@@ -42,12 +43,16 @@ public com.linkedin.metadata.query.LineageFlags apply( | |||||||||||||||||||||||||||||
if (lineageFlags.getIgnoreAsHops() != null) { | ||||||||||||||||||||||||||||||
result.setIgnoreAsHops(mapIgnoreAsHops(lineageFlags.getIgnoreAsHops())); | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
if (lineageFlags.getEndTimeMillis() != null) { | ||||||||||||||||||||||||||||||
result.setEndTimeMillis(lineageFlags.getEndTimeMillis()); | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
if (lineageFlags.getStartTimeMillis() != null) { | ||||||||||||||||||||||||||||||
result.setStartTimeMillis(lineageFlags.getStartTimeMillis()); | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
// Default to "now" if no end time is provided, but start time is provided. | ||||||||||||||||||||||||||||||
Long endTimeMillis = | ||||||||||||||||||||||||||||||
ResolverUtils.getLineageEndTimeMillis( | ||||||||||||||||||||||||||||||
lineageFlags.getStartTimeMillis(), lineageFlags.getEndTimeMillis()); | ||||||||||||||||||||||||||||||
if (endTimeMillis != null) { | ||||||||||||||||||||||||||||||
result.setEndTimeMillis(lineageFlags.getEndTimeMillis()); | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential Bug in Setting The method correctly calculates - result.setEndTimeMillis(lineageFlags.getEndTimeMillis());
+ result.setEndTimeMillis(endTimeMillis); Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
if (lineageFlags.getEntitiesExploredPerHopLimit() != null) { | ||||||||||||||||||||||||||||||
result.setEntitiesExploredPerHopLimit(lineageFlags.getEntitiesExploredPerHopLimit()); | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well-Implemented Method for Defaulting
endTimeMillis
The new method
getLineageEndTimeMillis
is implemented correctly. It provides a robust way to handle default end time values based on the presence of start time. This method is central to the PR's functionality and is well-integrated across the necessary files.Would you like me to help in writing unit tests for this method to cover various edge cases?