Skip to content

Commit

Permalink
[dagit] Link to the failed run, not the last materialzation, on “Fail…
Browse files Browse the repository at this point in the history
…ed" nodes (#11593)

### Summary & Motivation

Before:

Link is to the last successful materialization (note: I have another PR
to fix this weird wrapping thing, just started seeing this today
somehow)

<img width="459" alt="image"
src="https://user-images.githubusercontent.com/1037212/211416067-a3cc460e-5940-4ce8-b786-4bd4a3d46c92.png">

After:

Link is to the run logs for the run that failed, and shows the time of
the failure

<img width="371" alt="image"
src="https://user-images.githubusercontent.com/1037212/211415998-4b61f051-9a49-434a-b27d-1a2aee2fabb5.png">



### How I Tested These Changes

I tested this would not impact performance by verifying that adding
`endTime` to the live data request does not result in sql query fan-out
/ require data that isn't already loaded.

Co-authored-by: bengotow <bgotow@elementl.com>
  • Loading branch information
bengotow and bengotow committed Jan 12, 2023
1 parent 64c1881 commit af1707e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ export const LiveStates = () => {
lastMaterialization: null,
lastMaterializationRunStatus: null,
lastObservation: null,
runWhichFailedToMaterialize: {__typename: 'Run', id: 'ABCDEF', status: RunStatus.FAILURE},
runWhichFailedToMaterialize: {
__typename: 'Run',
id: 'ABCDEF',
status: RunStatus.FAILURE,
endTime: 1673301346,
},
currentLogicalVersion: null,
projectedLogicalVersion: null,
freshnessInfo: null,
Expand Down
14 changes: 13 additions & 1 deletion js_modules/dagit/packages/core/src/asset-graph/AssetNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,19 @@ export const AssetNodeStatusRow: React.FC<{
? humanizedLateString(liveData.freshnessInfo.currentMinutesLate)
: 'Failed'}
</Caption>
{lastMaterializationLink}

{runWhichFailedToMaterialize ? (
<Caption>
<AssetRunLink runId={runWhichFailedToMaterialize.id}>
<TimestampDisplay
timestamp={Number(runWhichFailedToMaterialize.endTime)}
timeFormat={{showSeconds: false, showTimezone: false}}
/>
</AssetRunLink>
</Caption>
) : (
lastMaterializationLink
)}
</AssetNodeStatusBox>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const ASSET_LATEST_INFO_FRAGMENT = graphql(`
fragment AssetLatestInfoRun on Run {
status
endTime
id
}
`);
Expand Down
4 changes: 2 additions & 2 deletions js_modules/dagit/packages/core/src/graphql/gql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions js_modules/dagit/packages/core/src/graphql/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af1707e

Please sign in to comment.