diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetNodeStatusContent.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetNodeStatusContent.tsx index e0069bd5818b2..a43cab7ab6cd0 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetNodeStatusContent.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetNodeStatusContent.tsx @@ -222,14 +222,14 @@ export function _buildAssetNodeStatusContent({ const numMissing = numPartitions - numFailed - numMaterialized; const {background, foreground, border} = StyleForAssetPartitionStatus[ - overdue || numFailed + overdue || numFailed || checksFailed ? AssetPartitionStatus.FAILED : numMissing ? AssetPartitionStatus.MISSING : AssetPartitionStatus.MATERIALIZED ]; const statusCase = - overdue || numFailed + overdue || numFailed || checksFailed ? (StatusCase.PARTITIONS_FAILED as const) : numMissing ? (StatusCase.PARTITIONS_MISSING as const) @@ -302,8 +302,10 @@ export function _buildAssetNodeStatusContent({ ) : runWhichFailedToMaterialize ? ( Failed - ) : ( + ) : lastMaterialization ? ( Materialized + ) : ( + Never materialized )} {expanded && } diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/__fixtures__/AssetNode.fixtures.ts b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/__fixtures__/AssetNode.fixtures.ts index f68d6a1f2bac8..80c9ee7b6e7a1 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/__fixtures__/AssetNode.fixtures.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/__fixtures__/AssetNode.fixtures.ts @@ -696,6 +696,16 @@ export const AssetNodeScenariosBase = [ expectedText: ['Never materialized'], }, + { + title: 'Never Materialized, Failed Check', + liveData: { + ...LiveDataForNodeNeverMaterialized, + assetChecks: LiveDataForNodeMaterializedWithChecks.assetChecks, + }, + definition: AssetNodeFragmentBasic, + expectedText: ['Never materialized'], + }, + { title: 'Materialized', liveData: LiveDataForNodeMaterialized, diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/types/useLiveDataForAssetKeys.types.ts b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/types/useLiveDataForAssetKeys.types.ts index 2c42d78481249..2d74dbf828b92 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/types/useLiveDataForAssetKeys.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/types/useLiveDataForAssetKeys.types.ts @@ -45,6 +45,7 @@ export type AssetNodeLiveFragment = { id: string; runId: string; status: Types.AssetCheckExecutionResolvedStatus; + stepKey: string | null; evaluation: {__typename: 'AssetCheckEvaluation'; severity: Types.AssetCheckSeverity} | null; } | null; }>; @@ -110,6 +111,7 @@ export type AssetGraphLiveQuery = { id: string; runId: string; status: Types.AssetCheckExecutionResolvedStatus; + stepKey: string | null; evaluation: {__typename: 'AssetCheckEvaluation'; severity: Types.AssetCheckSeverity} | null; } | null; }>; diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useLiveDataForAssetKeys.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useLiveDataForAssetKeys.tsx index 98ee5c61a69a9..5e5743cf2d4b0 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useLiveDataForAssetKeys.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/useLiveDataForAssetKeys.tsx @@ -161,6 +161,7 @@ export const ASSET_NODE_LIVE_FRAGMENT = gql` id runId status + stepKey evaluation { severity } diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AssetSidebarActivitySummary.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AssetSidebarActivitySummary.tsx index d96a446aa472a..eefb848cbad21 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AssetSidebarActivitySummary.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AssetSidebarActivitySummary.tsx @@ -175,10 +175,7 @@ export const AssetSidebarActivitySummary: React.FC = ({ }} > - + ))} {liveData.assetChecks.length > 10 && ( diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckDetailModal.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckDetailModal.tsx index a5b2142293813..1c4cf5e622c6e 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckDetailModal.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckDetailModal.tsx @@ -26,6 +26,7 @@ import {AssetKeyInput} from '../../graphql/types'; import {useDocumentTitle} from '../../hooks/useDocumentTitle'; import {METADATA_ENTRY_FRAGMENT, MetadataEntries} from '../../metadata/MetadataEntry'; import {MetadataEntryFragment} from '../../metadata/types/MetadataEntry.types'; +import {linkToRunEvent} from '../../runs/RunUtils'; import {useCursorPaginatedQuery} from '../../runs/useCursorPaginatedQuery'; import {TimestampDisplay} from '../../schedules/TimestampDisplay'; @@ -173,11 +174,16 @@ const AssetCheckDetailModalImpl = ({ {execution.evaluation?.timestamp ? ( - + ) : ( - ' - ' + )} @@ -192,7 +198,7 @@ const AssetCheckDetailModalImpl = ({ )} - + @@ -255,6 +261,8 @@ export const ASSET_CHECK_EXECUTION_FRAGMENT = gql` id runId status + stepKey + timestamp evaluation { severity timestamp diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckStatusTag.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckStatusTag.tsx index 32d58e08ea6b2..fedf4859850f2 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckStatusTag.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckStatusTag.tsx @@ -2,22 +2,23 @@ import {BaseTag, Box, Colors, Icon, Spinner, Tag} from '@dagster-io/ui-component import * as React from 'react'; import {assertUnreachable} from '../../app/Util'; -import {AssetCheckExecutionResolvedStatus, AssetCheckSeverity} from '../../graphql/types'; +import { + AssetCheckEvaluation, + AssetCheckExecution, + AssetCheckExecutionResolvedStatus, + AssetCheckSeverity, +} from '../../graphql/types'; +import {linkToRunEvent} from '../../runs/RunUtils'; import {TagActionsPopover} from '../../ui/TagActions'; export const AssetCheckStatusTag = ({ execution, }: { - check: { - name: string; - }; - execution: { - runId: string; - status: AssetCheckExecutionResolvedStatus; - evaluation?: { - severity: AssetCheckSeverity; - } | null; - } | null; + execution: + | (Pick & { + evaluation: Pick | null; + }) + | null; }) => { // Note: this uses BaseTag for a "grayer" style than the default tag intent if (!execution) { @@ -83,7 +84,10 @@ export const AssetCheckStatusTag = ({ actions={[ { label: 'View in run logs', - to: `/runs/${runId}`, + to: linkToRunEvent( + {id: runId}, + {stepKey: execution.stepKey, timestamp: execution.timestamp}, + ), }, ]} > diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/VirtualizedAssetCheckTable.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/VirtualizedAssetCheckTable.tsx index 3e92d34c741b6..6e83692764753 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/VirtualizedAssetCheckTable.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/VirtualizedAssetCheckTable.tsx @@ -5,6 +5,7 @@ import * as React from 'react'; import {Link} from 'react-router-dom'; import styled from 'styled-components'; +import {linkToRunEvent} from '../../runs/RunUtils'; import {TimestampDisplay} from '../../schedules/TimestampDisplay'; import {testId} from '../../testing/testId'; import {HeaderCell, Row, RowCell, Container, Inner} from '../../ui/VirtualizedTable'; @@ -86,12 +87,17 @@ export const VirtualizedAssetCheckRow = ({assetNode, height, start, row}: AssetC
- +
{timestamp ? ( - + ) : ( diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetCheckDetailModal.types.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetCheckDetailModal.types.ts index e10f5bb9226e2..c98c59c5ae2bf 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetCheckDetailModal.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetCheckDetailModal.types.ts @@ -7,6 +7,8 @@ export type AssetCheckExecutionFragment = { id: string; runId: string; status: Types.AssetCheckExecutionResolvedStatus; + stepKey: string | null; + timestamp: number; evaluation: { __typename: 'AssetCheckEvaluation'; severity: Types.AssetCheckSeverity; @@ -151,6 +153,8 @@ export type AssetCheckDetailsQuery = { id: string; runId: string; status: Types.AssetCheckExecutionResolvedStatus; + stepKey: string | null; + timestamp: number; evaluation: { __typename: 'AssetCheckEvaluation'; severity: Types.AssetCheckSeverity; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetChecks.types.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetChecks.types.ts index f4f76deefcb4e..4bddcb2ef6412 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetChecks.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/AssetChecks.types.ts @@ -38,6 +38,8 @@ export type AssetChecksQuery = { id: string; runId: string; status: Types.AssetCheckExecutionResolvedStatus; + stepKey: string | null; + timestamp: number; evaluation: { __typename: 'AssetCheckEvaluation'; severity: Types.AssetCheckSeverity; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/VirtualizedAssetCheckTable.types.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/VirtualizedAssetCheckTable.types.ts index 453f27622f713..d8f7ab9d81a3e 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/VirtualizedAssetCheckTable.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/types/VirtualizedAssetCheckTable.types.ts @@ -12,6 +12,8 @@ export type AssetCheckTableFragment = { id: string; runId: string; status: Types.AssetCheckExecutionResolvedStatus; + stepKey: string | null; + timestamp: number; evaluation: { __typename: 'AssetCheckEvaluation'; severity: Types.AssetCheckSeverity; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunUtils.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunUtils.tsx index 6c6a0cb812147..a7224c37a2256 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/RunUtils.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunUtils.tsx @@ -36,7 +36,7 @@ export function assetKeysForRun(run: { export function linkToRunEvent( run: {id: string}, - event: {timestamp?: string; stepKey: string | null}, + event: {timestamp?: string | number; stepKey: string | null}, ) { return `/runs/${run.id}?${qs.stringify({ focusedTime: event.timestamp ? Number(event.timestamp) : undefined,