-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(ui) Retrieve last ingested timestamp and display on frontend #5600
feat(ui) Retrieve last ingested timestamp and display on frontend #5600
Conversation
@@ -62,6 +63,9 @@ public Chart apply(@Nonnull final EntityResponse entityResponse) { | |||
result.setUrn(entityResponse.getUrn().toString()); | |||
result.setType(EntityType.CHART); | |||
EnvelopedAspectMap aspectMap = entityResponse.getAspects(); | |||
Long lastIngested = SystemMetadataUtils.getLastIngested(aspectMap); |
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.
Nice!
SystemMetadata systemMetadata = aspectMap.get(aspect).getSystemMetadata(); | ||
if (systemMetadata.hasRunId() && !systemMetadata.getRunId().equals(DEFAULT_RUN_ID) && systemMetadata.hasLastObserved()) { | ||
Long lastObserved = systemMetadata.getLastObserved(); | ||
if (lastIngested == null || lastObserved > lastIngested) { |
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.
Nice!
@@ -39,6 +40,8 @@ public static Container map(final EntityResponse entityResponse) { | |||
final Container result = new Container(); | |||
final Urn entityUrn = entityResponse.getUrn(); | |||
final EnvelopedAspectMap aspects = entityResponse.getAspects(); | |||
Long lastIngested = SystemMetadataUtils.getLastIngested(aspects); |
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.
One thing to keep in mind -- There is a possibility that in the future we become smarter about which aspects we fetch here. At that time we'll need to make some decisions...
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.
totally - always good to keep that in mind!
entityRegistry: EntityRegistry, | ||
entityType: EntityType, | ||
) { | ||
const entityTypeCased = |
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.
Nice refactor!
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.
Nice work, @chriscollins3456 !
Sorry for reviving this merged PR, @chriscollins3456 , but can I confirm if the logic considers TimeSeriesAspects as well? that is, if i programmatically ONLY form a time series aspect containing datasetStats and include a runId and lastObserved in the MCP, the last synchronized timestamp will also be updated? |
This PR gets the timestamp for when a dataset entity was last ingested by checking all of its aspects for the most recent
lastObserved
in itssystemMetadata
where therunId
exists and is not the default (no-run-id-provided
) which means that ingestion is what last touched this aspect.Here's what it's looking like on the frontend:
within 1 week of ingestion, green
on hover
hovering over the help icon
Orange when it's more than a week but less than a month
Red when it's more than a month since
Checklist