Skip to content

Commit 5a7a60e

Browse files
committed
freshness ui
1 parent 867a482 commit 5a7a60e

File tree

5 files changed

+40
-4
lines changed

5 files changed

+40
-4
lines changed

Diff for: js_modules/dagster-ui/packages/ui-core/client.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js_modules/dagster-ui/packages/ui-core/src/asset-data/AssetHealthDataProvider.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export const ASSETS_HEALTH_INFO_QUERY = gql`
8282
...AssetHealthCheckUnknownMetaFragment
8383
}
8484
freshnessStatus
85+
freshnessStatusMetadata {
86+
...AssetHealthFreshnessMetaFragment
87+
}
8588
}
8689
}
8790
@@ -114,6 +117,10 @@ export const ASSETS_HEALTH_INFO_QUERY = gql`
114117
numNotExecutedChecks
115118
totalNumChecks
116119
}
120+
121+
fragment AssetHealthFreshnessMetaFragment on AssetHealthFreshnessMeta {
122+
lastMaterializedTimestamp
123+
}
117124
`;
118125

119126
// For tests

Diff for: js_modules/dagster-ui/packages/ui-core/src/asset-data/types/AssetHealthDataProvider.types.ts

+14-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js_modules/dagster-ui/packages/ui-core/src/assets/AssetHealthSummary.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
AssetHealthMaterializationDegradedNotPartitionedMetaFragment,
2727
AssetHealthMaterializationDegradedPartitionedMetaFragment,
2828
AssetHealthMaterializationWarningPartitionedMetaFragment,
29+
AssetHealthFreshnessMetaFragment,
2930
} from '../asset-data/types/AssetHealthDataProvider.types';
3031
import {AssetHealthStatus} from '../graphql/types';
3132
import {numberFormatter} from '../ui/formatters';
@@ -85,6 +86,11 @@ export const AssetHealthSummary = React.memo(
8586
assetKey={key}
8687
text="Has no freshness violations"
8788
status={health?.freshnessStatus}
89+
explanation={
90+
!health || health?.freshnessStatus === AssetHealthStatus.NOT_APPLICABLE
91+
? 'No freshness policy defined'
92+
: undefined
93+
}
8894
/>
8995
<Criteria
9096
assetKey={key}
@@ -126,6 +132,7 @@ const Criteria = React.memo(
126132
| AssetHealthMaterializationDegradedNotPartitionedMetaFragment
127133
| AssetHealthMaterializationDegradedPartitionedMetaFragment
128134
| AssetHealthMaterializationWarningPartitionedMetaFragment
135+
| AssetHealthFreshnessMetaFragment
129136
| undefined
130137
| null;
131138
explanation?: string;
@@ -236,6 +243,15 @@ const Criteria = React.memo(
236243
</Link>
237244
</Body>
238245
);
246+
case 'AssetHealthFreshnessMeta':
247+
if (metadata.lastMaterializedTimestamp === null) {
248+
return <Body>No materializations</Body>;
249+
}
250+
return (
251+
<Body>
252+
Last materialized at {new Date(metadata.lastMaterializedTimestamp).toLocaleString()}
253+
</Body>
254+
);
239255
case undefined:
240256
return null;
241257
default:

Diff for: python_modules/dagster/dagster/_core/storage/event_log/sql_event_log.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2057,14 +2057,14 @@ def get_paginated_dynamic_partitions(
20572057
rows = conn.execute(query).fetchall()
20582058

20592059
if rows:
2060-
next_cursor = StorageIdCursor(storage_id=cast(int, rows[-1][0])).to_string()
2060+
next_cursor = StorageIdCursor(storage_id=cast("int", rows[-1][0])).to_string()
20612061
elif cursor:
20622062
next_cursor = cursor
20632063
else:
20642064
next_cursor = StorageIdCursor(storage_id=-1).to_string()
20652065

20662066
return PaginatedResults(
2067-
results=[cast(str, row[1]) for row in rows],
2067+
results=[cast("str", row[1]) for row in rows],
20682068
cursor=next_cursor,
20692069
has_more=len(rows) == limit,
20702070
)

0 commit comments

Comments
 (0)