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

[ui] Show warning on partitions that did not materialize due to canceled runs #28045

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -266,14 +266,14 @@ export const AssetPartitionDetail = ({
)}
<div style={{flex: 1}} />
</Box>
{currentRun?.status === RunStatus.FAILURE && (
{currentRun?.status === RunStatus.FAILURE || currentRun?.status === RunStatus.CANCELED ? (
<FailedRunSinceMaterializationBanner
run={currentRun}
stepKey={stepKey}
padding={{horizontal: 0, vertical: 16}}
border="bottom"
/>
)}
) : null}
{currentRun && currentRunStatusMessage && (
<Alert
intent="info"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Alert, Box} from '@dagster-io/ui-components';
import {Alert, Box, Mono} from '@dagster-io/ui-components';
import {
BorderSetting,
BorderSide,
Expand All @@ -7,6 +7,7 @@ import {
import {Link} from 'react-router-dom';

import {AssetLatestInfoRunFragment} from '../asset-data/types/AssetBaseDataProvider.types';
import {RunStatus} from '../graphql/types';
import {titleForRun} from '../runs/RunUtils';
import {useStepLogs} from '../runs/StepLogsDialog';

Expand All @@ -23,6 +24,36 @@ export const FailedRunSinceMaterializationBanner = ({
}) => {
const stepLogs = useStepLogs({runId: run?.id, stepKeys: stepKey ? [stepKey] : []});

const alertIntent = run?.status === RunStatus.CANCELED ? 'warning' : 'error';

const content = () => {
if (run?.status === RunStatus.CANCELED) {
return (
<>
Run{' '}
<Link to={`/runs/${run.id}`}>
<Mono style={{fontWeight: 600}}>{titleForRun(run)}</Mono>
</Link>{' '}
was canceled, and did not materialize this asset.
</>
);
}

if (run?.status === RunStatus.FAILURE) {
return (
<>
Run{' '}
<Link to={`/runs/${run.id}`}>
<Mono style={{fontWeight: 600}}>{titleForRun(run)}</Mono>
</Link>{' '}
failed, and did not materialize this asset.
</>
);
}

return null;
};

return (
<>
{stepLogs.dialog}
Expand All @@ -34,17 +65,7 @@ export const FailedRunSinceMaterializationBanner = ({
style={{width: '100%'}}
>
<div style={{flex: 1}}>
<Alert
intent="error"
title={
<Box flex={{justifyContent: 'space-between'}}>
<div style={{fontWeight: 400}}>
Run <Link to={`/runs/${run.id}`}>{titleForRun(run)}</Link> failed to materialize
this asset.
</div>
</Box>
}
/>
<Alert intent={alertIntent} title={content()} />
</div>
{stepLogs.button}
</Box>
Expand Down