diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx index 3108c020abe92..c1a31f38b5364 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx @@ -155,6 +155,7 @@ import status from '../icon-svgs/status.svg'; import sticky_note from '../icon-svgs/sticky_note.svg'; import sync_alt from '../icon-svgs/sync_alt.svg'; import sync_problem from '../icon-svgs/sync_problem.svg'; +import table_rows from '../icon-svgs/table_rows.svg'; import table_view from '../icon-svgs/table_view.svg'; import tag from '../icon-svgs/tag.svg'; import timer from '../icon-svgs/timer.svg'; @@ -220,6 +221,7 @@ export const Icons = { sensors, schedule, source_asset, + table_rows, workspace: source, gantt_flat, gantt_waterfall, diff --git a/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/table_rows.svg b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/table_rows.svg new file mode 100644 index 0000000000000..a2e539669a831 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/table_rows.svg @@ -0,0 +1,3 @@ + + + diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AssetNodeOverview.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AssetNodeOverview.tsx index bb1834c600047..0014aad5827d5 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AssetNodeOverview.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AssetNodeOverview.tsx @@ -52,7 +52,9 @@ import {StatusDot} from '../asset-graph/sidebar/StatusDot'; import {AssetNodeForGraphQueryFragment} from '../asset-graph/types/useAssetGraphData.types'; import {DagsterTypeSummary} from '../dagstertype/DagsterType'; import {AssetComputeKindTag} from '../graph/OpTags'; +import {IntMetadataEntry} from '../graphql/types'; import {useLaunchPadHooks} from '../launchpad/LaunchpadHooksContext'; +import {isCanonicalRowCountMetadataEntry} from '../metadata/MetadataEntry'; import {TableSchema, TableSchemaAssetContext} from '../metadata/TableSchema'; import {RepositoryLink} from '../nav/RepositoryLink'; import {ScheduleOrSensorTag} from '../nav/ScheduleOrSensorTag'; @@ -117,10 +119,14 @@ export const AssetNodeOverview = ({ definitionLoadTimestamp: assetNodeLoadTimestamp, }); + const rowCountMeta: IntMetadataEntry | undefined = materialization?.metadataEntries.find( + (entry) => isCanonicalRowCountMetadataEntry(entry), + ) as IntMetadataEntry | undefined; + const renderStatusSection = () => ( - + Latest {assetNode?.isSource ? 'observation' : 'materialization'} {liveData ? ( @@ -134,7 +140,7 @@ export const AssetNodeOverview = ({ {liveData?.assetChecks.length ? ( - + Check results ) : undefined} + {rowCountMeta ? ( + + Row count + + {rowCountMeta.intValue} + + + ) : undefined} {assetNode.isPartitioned ? null : ( ; + +export const isCanonicalRowCountMetadataEntry = ( + m: MetadataEntryLabelOnly, +): m is IntMetadataEntry => + m && m.__typename === 'IntMetadataEntry' && m.label === 'dagster/row_count'; + export const LogRowStructuredContentTable = ({ rows, styles, diff --git a/js_modules/dagster-ui/packages/ui-core/src/metadata/TableSchema.tsx b/js_modules/dagster-ui/packages/ui-core/src/metadata/TableSchema.tsx index 644d510beb769..b50ed74ee9c8e 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/metadata/TableSchema.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/metadata/TableSchema.tsx @@ -12,6 +12,7 @@ import { import {Spacing} from '@dagster-io/ui-components/src/components/types'; import {createContext, useContext, useState} from 'react'; +import {MetadataEntryLabelOnly} from './MetadataEntry'; import {TableSchemaFragment} from './types/TableSchemaFragment.types'; import {Timestamp} from '../app/time/Timestamp'; import {StyledTableWithHeader} from '../assets/AssetEventMetadataEntriesTable'; @@ -19,7 +20,6 @@ import {AssetFeatureContext} from '../assets/AssetFeatureContext'; import { AssetKeyInput, CodeReferencesMetadataEntry, - MaterializationEvent, TableColumnLineageMetadataEntry, TableSchemaMetadataEntry, } from '../graphql/types'; @@ -35,11 +35,6 @@ interface ITableSchemaProps { itemHorizontalPadding?: Spacing; } -type MetadataEntryLabelOnly = Pick< - MaterializationEvent['metadataEntries'][0], - '__typename' | 'label' ->; - export const isCanonicalColumnSchemaEntry = ( m: MetadataEntryLabelOnly, ): m is TableSchemaMetadataEntry =>