From 0b347b6c6edd8c88656672ef108965768f1331f7 Mon Sep 17 00:00:00 2001 From: Owen Kephart Date: Wed, 27 Nov 2024 13:47:12 -0500 Subject: [PATCH] [ui] Implement new asset Automation page --- .../src/components/CursorControls.tsx | 1 + .../dagster-ui/packages/ui-core/client.json | 3 +- .../packages/ui-core/src/assets/AssetView.tsx | 15 +- .../AssetAutomaterializePolicyPage.tsx | 16 +- .../AssetAutomationRoot.tsx | 72 +++ .../EvaluationDetailDialog.tsx | 54 ++- .../EvaluationList.tsx | 16 +- .../EvaluationListRow.tsx | 29 +- .../EvaluationStatusTag.tsx | 2 +- .../GetEvaluationsQuery.tsx | 47 +- .../QueryfulEvaluationDetailTable.tsx | 2 +- .../types/GetEvaluationsQuery.types.ts | 436 +++++++++++++++++- .../useEvaluationsQueryResult.tsx | 22 +- .../src/graphql/possibleTypes.generated.json | 2 +- .../ui-core/src/graphql/schema.graphql | 13 +- .../packages/ui-core/src/graphql/types.ts | 25 +- .../instigation/TickMaterializationsTable.tsx | 2 +- .../src/runs/useCursorPaginatedQuery.tsx | 1 + .../implementation/fetch_asset_checks.py | 11 +- .../fetch_asset_condition_evaluations.py | 27 +- .../dagster_graphql/schema/__init__.py | 2 +- .../dagster_graphql/schema/asset_checks.py | 37 +- .../schema/asset_condition_evaluations.py | 11 +- .../dagster_graphql/schema/asset_graph.py | 4 +- .../dagster_graphql/schema/asset_key.py | 18 - .../schema/asset_selections.py | 2 +- .../auto_materialize_asset_evaluations.py | 2 +- .../dagster_graphql/schema/backfill.py | 4 +- .../dagster_graphql/schema/entity_key.py | 44 ++ .../dagster_graphql/schema/instigation.py | 2 +- .../dagster_graphql/schema/logs/events.py | 2 +- .../dagster_graphql/schema/metadata.py | 2 +- .../dagster_graphql/schema/partition_sets.py | 2 +- .../schema/pipelines/pipeline.py | 3 +- .../dagster_graphql/schema/resources.py | 2 +- .../dagster_graphql/schema/roots/mutation.py | 2 +- .../dagster_graphql/schema/roots/query.py | 21 +- .../dagster_graphql/schema/runs_feed.py | 4 +- .../dagster_graphql/schema/sensors.py | 2 +- .../dagster_graphql/schema/table.py | 2 +- .../core/component_generator.py | 1 + 41 files changed, 818 insertions(+), 147 deletions(-) create mode 100644 js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomationRoot.tsx delete mode 100644 python_modules/dagster-graphql/dagster_graphql/schema/asset_key.py create mode 100644 python_modules/dagster-graphql/dagster_graphql/schema/entity_key.py create mode 100644 python_modules/libraries/dagster-components/dagster_components/core/component_generator.py diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx index 06e85da63b8be..1ae09c970a966 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx @@ -4,6 +4,7 @@ import {Button} from './Button'; import {Icon} from './Icon'; export interface CursorPaginationProps { + cursor?: string; hasPrevCursor: boolean; hasNextCursor: boolean; popCursor: () => void; diff --git a/js_modules/dagster-ui/packages/ui-core/client.json b/js_modules/dagster-ui/packages/ui-core/client.json index 8e9e8ae0c4b40..de992f056747a 100644 --- a/js_modules/dagster-ui/packages/ui-core/client.json +++ b/js_modules/dagster-ui/packages/ui-core/client.json @@ -21,7 +21,8 @@ "RunStatusOnlyQuery": "e0000c8f2600dbe29f305febb04cca005e08da6a7ce03ec20476c59d607495c0", "AutomaterializeRunsQuery": "213e0a8e4d88de599b4740ba7d0d4bfac14defebcc8f3813eecc13696b9f17d9", "FullPartitionsQuery": "bfe939600c7396798b3c92b0e8335e639c9d76479c1cecaabc309a83c8f7ca4d", - "GetEvaluationsQuery": "22cc08d87eec75cfec1f054f4d222b5a2478c47fc1a6788024d5902e3b7db197", + "GetEvaluationsQuery": "ffbe804f3dcaaf3923223096d1cd5cdd39773945fe75045d131e0144bee5c3d9", + "GetSlimEvaluationsQuery": "040bf5d6f79ce3c06d75f4410e5386df795c546f10d3180e3ee7cb3ddac949e3", "GetEvaluationsSpecificPartitionQuery": "7c47ec6fee7ebf9edf6c5d57294f5a603e6a599884841eb211a1de9422c3791c", "PartitionSubsetListQuery": "9a560790b6c1828137f31532f5879cfb6611d9ca8c14b7f315464510b6a4bd75", "AutoMaterializeSensorFlag": "961162c030e7e3c35be91db37c1990ad31b53cb8225d216fece2bdc2a6210bce", diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AssetView.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AssetView.tsx index 4e0e1888700b7..3e00784ac5b30 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AssetView.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AssetView.tsx @@ -15,7 +15,7 @@ import {AssetPartitions} from './AssetPartitions'; import {AssetPlotsPage} from './AssetPlotsPage'; import {AssetTabs} from './AssetTabs'; import {useAllAssets} from './AssetsCatalogTable'; -import {AssetAutomaterializePolicyPage} from './AutoMaterializePolicyPage/AssetAutomaterializePolicyPage'; +import {AssetAutomationRoot} from './AutoMaterializePolicyPage/AssetAutomationRoot'; import {ChangedReasonsTag} from './ChangedReasons'; import {LaunchAssetExecutionButton} from './LaunchAssetExecutionButton'; import {UNDERLYING_OPS_ASSET_NODE_FRAGMENT} from './UnderlyingOpsOrGraph'; @@ -23,17 +23,17 @@ import {AssetChecks} from './asset-checks/AssetChecks'; import {assetDetailsPathForKey} from './assetDetailsPathForKey'; import {AssetNodeOverview, AssetNodeOverviewNonSDA} from './overview/AssetNodeOverview'; import {AssetKey, AssetViewParams} from './types'; +import {healthRefreshHintFromLiveData} from './usePartitionHealthData'; +import {useReportEventsModal} from './useReportEventsModal'; +import {useWipeModal} from './useWipeModal'; +import {gql, useQuery} from '../apollo-client'; +import {AssetTableDefinitionFragment} from './types/AssetTableFragment.types'; import { AssetViewDefinitionNodeFragment, AssetViewDefinitionQuery, AssetViewDefinitionQueryVariables, } from './types/AssetView.types'; import {useDeleteDynamicPartitionsDialog} from './useDeleteDynamicPartitionsDialog'; -import {healthRefreshHintFromLiveData} from './usePartitionHealthData'; -import {useReportEventsModal} from './useReportEventsModal'; -import {useWipeModal} from './useWipeModal'; -import {gql, useQuery} from '../apollo-client'; -import {AssetTableDefinitionFragment} from './types/AssetTableFragment.types'; import {currentPageAtom} from '../app/analytics'; import {Timestamp} from '../app/time/Timestamp'; import {AssetLiveDataRefreshButton, useAssetLiveData} from '../asset-data/AssetLiveDataProvider'; @@ -221,7 +221,8 @@ export const AssetView = ({assetKey, headerBreadcrumbs, writeAssetVisit, current if (isLoading) { return ; } - return ; + + return ; }; const renderChecksTab = () => { diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomaterializePolicyPage.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomaterializePolicyPage.tsx index 70b3570890991..dbb5f4833e14c 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomaterializePolicyPage.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomaterializePolicyPage.tsx @@ -22,24 +22,10 @@ export const AssetAutomaterializePolicyPage = ({ assetKey: AssetKey; definition?: AssetViewDefinitionNodeFragment | null; }) => { - const {queryResult, paginationProps} = useEvaluationsQueryResult({assetKey}); + const {queryResult, evaluations, paginationProps} = useEvaluationsQueryResult({assetKey}); useQueryRefreshAtInterval(queryResult, FIFTEEN_SECONDS); - const evaluations = useMemo(() => { - if ( - queryResult.data?.assetConditionEvaluationRecordsOrError?.__typename === - 'AssetConditionEvaluationRecords' && - queryResult.data?.assetNodeOrError?.__typename === 'AssetNode' - ) { - return queryResult.data?.assetConditionEvaluationRecordsOrError.records; - } - return []; - }, [ - queryResult.data?.assetConditionEvaluationRecordsOrError, - queryResult.data?.assetNodeOrError, - ]); - const isFirstPage = !paginationProps.hasPrevCursor; const [selectedEvaluationId, setSelectedEvaluationId] = useQueryPersistedState< diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomationRoot.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomationRoot.tsx new file mode 100644 index 0000000000000..4052d069a05b8 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AssetAutomationRoot.tsx @@ -0,0 +1,72 @@ +import { + Box, + CursorHistoryControls, + NonIdealState, + SpinnerWithText, +} from '@dagster-io/ui-components'; +import {useEffect, useRef} from 'react'; + +import {useEvaluationsQueryResult} from './useEvaluationsQueryResult'; +import {FIFTEEN_SECONDS, useQueryRefreshAtInterval} from '../../app/QueryRefresh'; +import {AssetKey} from '../types'; +import {EvaluationList} from './EvaluationList'; +import {AssetViewDefinitionNodeFragment} from '../types/AssetView.types'; + +interface Props { + assetKey: AssetKey; + definition: AssetViewDefinitionNodeFragment | null; +} + +export const AssetAutomationRoot = ({assetKey, definition}: Props) => { + const {queryResult, evaluations, paginationProps} = useEvaluationsQueryResult({assetKey}); + const {data, loading} = queryResult; + + const scrollRef = useRef(null); + + // When paginating, reset scroll to top. + useEffect(() => { + if (scrollRef.current) { + scrollRef.current.scrollTo({top: 0, behavior: 'instant'}); + } + }, [paginationProps.cursor]); + + useQueryRefreshAtInterval(queryResult, FIFTEEN_SECONDS); + + if (loading && !data) { + return ( + + + + ); + } + + if (!definition) { + return ( + + + + ); + } + + return ( + <> + + + +
+ +
+ + ); +}; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationDetailDialog.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationDetailDialog.tsx index b5008856ce22a..a2f9651e00bb0 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationDetailDialog.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationDetailDialog.tsx @@ -10,10 +10,13 @@ import { } from '@dagster-io/ui-components'; import {ReactNode, useState} from 'react'; -import {GET_EVALUATIONS_QUERY} from './GetEvaluationsQuery'; +import {GET_SLIM_EVALUATIONS_QUERY} from './GetEvaluationsQuery'; import {PartitionTagSelector} from './PartitionTagSelector'; import {QueryfulEvaluationDetailTable} from './QueryfulEvaluationDetailTable'; -import {GetEvaluationsQuery, GetEvaluationsQueryVariables} from './types/GetEvaluationsQuery.types'; +import { + GetSlimEvaluationsQuery, + GetSlimEvaluationsQueryVariables, +} from './types/GetEvaluationsQuery.types'; import {usePartitionsForAssetKey} from './usePartitionsForAssetKey'; import {useQuery} from '../../apollo-client'; import {DEFAULT_TIME_FORMAT} from '../../app/time/TimestampFormat'; @@ -21,18 +24,26 @@ import {TimestampDisplay} from '../../schedules/TimestampDisplay'; interface Props { isOpen: boolean; - setIsOpen: (isOpen: boolean) => void; + onClose: () => void; assetKeyPath: string[]; + assetCheckName?: string; evaluationID: string; } -export const EvaluationDetailDialog = ({isOpen, setIsOpen, evaluationID, assetKeyPath}: Props) => { +export const EvaluationDetailDialog = ({ + isOpen, + onClose, + evaluationID, + assetKeyPath, + assetCheckName, +}: Props) => { return ( - setIsOpen(false)} style={EvaluationDetailDialogStyle}> + ); @@ -41,17 +52,26 @@ export const EvaluationDetailDialog = ({isOpen, setIsOpen, evaluationID, assetKe interface ContentProps { evaluationID: string; assetKeyPath: string[]; - setIsOpen: (isOpen: boolean) => void; + assetCheckName?: string; + onClose: () => void; } -const EvaluationDetailDialogContents = ({evaluationID, assetKeyPath, setIsOpen}: ContentProps) => { +const EvaluationDetailDialogContents = ({ + evaluationID, + assetKeyPath, + assetCheckName, + onClose, +}: ContentProps) => { const [selectedPartition, setSelectedPartition] = useState(null); - const {data, loading} = useQuery( - GET_EVALUATIONS_QUERY, + const {data, loading} = useQuery( + GET_SLIM_EVALUATIONS_QUERY, { variables: { - assetKey: {path: assetKeyPath}, + assetKey: assetCheckName ? null : {path: assetKeyPath}, + assetCheckKey: assetCheckName + ? {assetKey: {path: assetKeyPath}, name: assetCheckName} + : null, cursor: `${BigInt(evaluationID) + 1n}`, limit: 2, }, @@ -70,7 +90,7 @@ const EvaluationDetailDialogContents = ({evaluationID, assetKeyPath, setIsOpen}: } - onDone={() => setIsOpen(false)} + onDone={onClose} /> ); } @@ -90,12 +110,12 @@ const EvaluationDetailDialogContents = ({evaluationID, assetKeyPath, setIsOpen}: /> } - onDone={() => setIsOpen(false)} + onDone={onClose} /> ); } - const evaluation = record?.records[0]; + const evaluation = record?.records.find((r) => r.evaluationId === evaluationID); if (!evaluation) { return ( @@ -114,7 +134,7 @@ const EvaluationDetailDialogContents = ({evaluationID, assetKeyPath, setIsOpen}: /> } - onDone={() => setIsOpen(false)} + onDone={onClose} /> ); } @@ -135,7 +155,7 @@ const EvaluationDetailDialogContents = ({evaluationID, assetKeyPath, setIsOpen}: } /> - {allPartitions.length > 0 ? ( + {allPartitions.length > 0 && evaluation.isLegacy ? ( } - onDone={() => setIsOpen(false)} + onDone={onClose} /> ); }; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationList.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationList.tsx index 25daf6c8e841f..e27e6ed34e199 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationList.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationList.tsx @@ -1,4 +1,4 @@ -import {Table} from '@dagster-io/ui-components'; +import {Colors, Table} from '@dagster-io/ui-components'; import {AssetKey} from '../types'; import {EvaluationListRow} from './EvaluationListRow'; @@ -7,13 +7,22 @@ import {AssetConditionEvaluationRecordFragment} from './types/GetEvaluationsQuer interface Props { assetKey: AssetKey; isPartitioned: boolean; + assetCheckName?: string; evaluations: AssetConditionEvaluationRecordFragment[]; } -export const EvaluationList = ({assetKey, isPartitioned, evaluations}: Props) => { +export const EvaluationList = ({assetKey, isPartitioned, assetCheckName, evaluations}: Props) => { return ( - + @@ -27,6 +36,7 @@ export const EvaluationList = ({assetKey, isPartitioned, evaluations}: Props) => key={evaluation.id} evaluation={evaluation} assetKey={assetKey} + assetCheckName={assetCheckName} isPartitioned={isPartitioned} /> ); diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationListRow.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationListRow.tsx index c22f39cde199d..e918a49b255d9 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationListRow.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationListRow.tsx @@ -9,6 +9,7 @@ import { Mono, } from '@dagster-io/ui-components'; import {useState} from 'react'; +import {Link} from 'react-router-dom'; import {AssetKey} from '../types'; import {EvaluationDetailDialog} from './EvaluationDetailDialog'; @@ -20,11 +21,12 @@ import {TimestampDisplay} from '../../schedules/TimestampDisplay'; interface Props { assetKey: AssetKey; + assetCheckName?: string; isPartitioned: boolean; evaluation: AssetConditionEvaluationRecordFragment; } -export const EvaluationListRow = ({evaluation, assetKey, isPartitioned}: Props) => { +export const EvaluationListRow = ({evaluation, assetKey, assetCheckName, isPartitioned}: Props) => { const [isOpen, setIsOpen] = useState(false); return ( @@ -52,9 +54,10 @@ export const EvaluationListRow = ({evaluation, assetKey, isPartitioned}: Props) setIsOpen(false)} + evaluationID={evaluation.evaluationId} assetKeyPath={assetKey.path} + assetCheckName={assetCheckName} /> ); @@ -67,16 +70,28 @@ interface EvaluationRunInfoProps { const EvaluationRunInfo = ({runIds, timestamp}: EvaluationRunInfoProps) => { const [isOpen, setIsOpen] = useState(false); + const firstRun = runIds[0]; - if (runIds.length === 0) { + if (!firstRun) { return None; } if (runIds.length === 1) { + const truncated = firstRun.slice(0, 8); + + // This looks like a backfill ID. Link there. + if (truncated === firstRun) { + return ( + + {firstRun} + + ); + } + return ( - - {runIds[0]} - + + {truncated} + ); } diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationStatusTag.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationStatusTag.tsx index 2e2b21a794ff0..21b4f43e3d34b 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationStatusTag.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/EvaluationStatusTag.tsx @@ -44,7 +44,7 @@ export const EvaluationStatusTag = ({ hoverCloseDelay={50} content={ }; + assetKey: {__typename: 'AssetKey'; path: Array} | null; evaluation: { __typename: 'AssetConditionEvaluation'; rootUniqueId: string; @@ -731,6 +731,7 @@ export type AssetConditionEvaluationRecordFragment = { export type GetEvaluationsQueryVariables = Types.Exact<{ assetKey: Types.AssetKeyInput; + assetCheckKey?: Types.InputMaybe; limit: Types.Scalars['Int']['input']; cursor?: Types.InputMaybe; }>; @@ -765,7 +766,434 @@ export type GetEvaluationsQuery = { startTimestamp: number | null; endTimestamp: number | null; isLegacy: boolean; - assetKey: {__typename: 'AssetKey'; path: Array}; + assetKey: {__typename: 'AssetKey'; path: Array} | null; + evaluation: { + __typename: 'AssetConditionEvaluation'; + rootUniqueId: string; + evaluationNodes: Array< + | { + __typename: 'PartitionedAssetConditionEvaluationNode'; + description: string; + startTimestamp: number | null; + endTimestamp: number | null; + numTrue: number; + uniqueId: string; + childUniqueIds: Array; + numCandidates: number | null; + } + | { + __typename: 'SpecificPartitionAssetConditionEvaluationNode'; + description: string; + status: Types.AssetConditionEvaluationStatus; + uniqueId: string; + childUniqueIds: Array; + metadataEntries: Array< + | { + __typename: 'AssetMetadataEntry'; + label: string; + description: string | null; + assetKey: {__typename: 'AssetKey'; path: Array}; + } + | { + __typename: 'BoolMetadataEntry'; + boolValue: boolean | null; + label: string; + description: string | null; + } + | { + __typename: 'CodeReferencesMetadataEntry'; + label: string; + description: string | null; + codeReferences: Array< + | { + __typename: 'LocalFileCodeReference'; + filePath: string; + lineNumber: number | null; + label: string | null; + } + | {__typename: 'UrlCodeReference'; url: string; label: string | null} + >; + } + | { + __typename: 'FloatMetadataEntry'; + floatValue: number | null; + label: string; + description: string | null; + } + | { + __typename: 'IntMetadataEntry'; + intValue: number | null; + intRepr: string; + label: string; + description: string | null; + } + | { + __typename: 'JobMetadataEntry'; + jobName: string; + repositoryName: string | null; + locationName: string; + label: string; + description: string | null; + } + | { + __typename: 'JsonMetadataEntry'; + jsonString: string; + label: string; + description: string | null; + } + | { + __typename: 'MarkdownMetadataEntry'; + mdStr: string; + label: string; + description: string | null; + } + | { + __typename: 'NotebookMetadataEntry'; + path: string; + label: string; + description: string | null; + } + | {__typename: 'NullMetadataEntry'; label: string; description: string | null} + | { + __typename: 'PathMetadataEntry'; + path: string; + label: string; + description: string | null; + } + | { + __typename: 'PipelineRunMetadataEntry'; + runId: string; + label: string; + description: string | null; + } + | { + __typename: 'PythonArtifactMetadataEntry'; + module: string; + name: string; + label: string; + description: string | null; + } + | { + __typename: 'TableColumnLineageMetadataEntry'; + label: string; + description: string | null; + lineage: Array<{ + __typename: 'TableColumnLineageEntry'; + columnName: string; + columnDeps: Array<{ + __typename: 'TableColumnDep'; + columnName: string; + assetKey: {__typename: 'AssetKey'; path: Array}; + }>; + }>; + } + | { + __typename: 'TableMetadataEntry'; + label: string; + description: string | null; + table: { + __typename: 'Table'; + records: Array; + schema: { + __typename: 'TableSchema'; + columns: Array<{ + __typename: 'TableColumn'; + name: string; + description: string | null; + type: string; + tags: Array<{ + __typename: 'DefinitionTag'; + key: string; + value: string; + }>; + constraints: { + __typename: 'TableColumnConstraints'; + nullable: boolean; + unique: boolean; + other: Array; + }; + }>; + constraints: { + __typename: 'TableConstraints'; + other: Array; + } | null; + }; + }; + } + | { + __typename: 'TableSchemaMetadataEntry'; + label: string; + description: string | null; + schema: { + __typename: 'TableSchema'; + columns: Array<{ + __typename: 'TableColumn'; + name: string; + description: string | null; + type: string; + tags: Array<{__typename: 'DefinitionTag'; key: string; value: string}>; + constraints: { + __typename: 'TableColumnConstraints'; + nullable: boolean; + unique: boolean; + other: Array; + }; + }>; + constraints: { + __typename: 'TableConstraints'; + other: Array; + } | null; + }; + } + | { + __typename: 'TextMetadataEntry'; + text: string; + label: string; + description: string | null; + } + | { + __typename: 'TimestampMetadataEntry'; + timestamp: number; + label: string; + description: string | null; + } + | { + __typename: 'UrlMetadataEntry'; + url: string; + label: string; + description: string | null; + } + >; + } + | { + __typename: 'UnpartitionedAssetConditionEvaluationNode'; + description: string; + startTimestamp: number | null; + endTimestamp: number | null; + status: Types.AssetConditionEvaluationStatus; + uniqueId: string; + childUniqueIds: Array; + metadataEntries: Array< + | { + __typename: 'AssetMetadataEntry'; + label: string; + description: string | null; + assetKey: {__typename: 'AssetKey'; path: Array}; + } + | { + __typename: 'BoolMetadataEntry'; + boolValue: boolean | null; + label: string; + description: string | null; + } + | { + __typename: 'CodeReferencesMetadataEntry'; + label: string; + description: string | null; + codeReferences: Array< + | { + __typename: 'LocalFileCodeReference'; + filePath: string; + lineNumber: number | null; + label: string | null; + } + | {__typename: 'UrlCodeReference'; url: string; label: string | null} + >; + } + | { + __typename: 'FloatMetadataEntry'; + floatValue: number | null; + label: string; + description: string | null; + } + | { + __typename: 'IntMetadataEntry'; + intValue: number | null; + intRepr: string; + label: string; + description: string | null; + } + | { + __typename: 'JobMetadataEntry'; + jobName: string; + repositoryName: string | null; + locationName: string; + label: string; + description: string | null; + } + | { + __typename: 'JsonMetadataEntry'; + jsonString: string; + label: string; + description: string | null; + } + | { + __typename: 'MarkdownMetadataEntry'; + mdStr: string; + label: string; + description: string | null; + } + | { + __typename: 'NotebookMetadataEntry'; + path: string; + label: string; + description: string | null; + } + | {__typename: 'NullMetadataEntry'; label: string; description: string | null} + | { + __typename: 'PathMetadataEntry'; + path: string; + label: string; + description: string | null; + } + | { + __typename: 'PipelineRunMetadataEntry'; + runId: string; + label: string; + description: string | null; + } + | { + __typename: 'PythonArtifactMetadataEntry'; + module: string; + name: string; + label: string; + description: string | null; + } + | { + __typename: 'TableColumnLineageMetadataEntry'; + label: string; + description: string | null; + lineage: Array<{ + __typename: 'TableColumnLineageEntry'; + columnName: string; + columnDeps: Array<{ + __typename: 'TableColumnDep'; + columnName: string; + assetKey: {__typename: 'AssetKey'; path: Array}; + }>; + }>; + } + | { + __typename: 'TableMetadataEntry'; + label: string; + description: string | null; + table: { + __typename: 'Table'; + records: Array; + schema: { + __typename: 'TableSchema'; + columns: Array<{ + __typename: 'TableColumn'; + name: string; + description: string | null; + type: string; + tags: Array<{ + __typename: 'DefinitionTag'; + key: string; + value: string; + }>; + constraints: { + __typename: 'TableColumnConstraints'; + nullable: boolean; + unique: boolean; + other: Array; + }; + }>; + constraints: { + __typename: 'TableConstraints'; + other: Array; + } | null; + }; + }; + } + | { + __typename: 'TableSchemaMetadataEntry'; + label: string; + description: string | null; + schema: { + __typename: 'TableSchema'; + columns: Array<{ + __typename: 'TableColumn'; + name: string; + description: string | null; + type: string; + tags: Array<{__typename: 'DefinitionTag'; key: string; value: string}>; + constraints: { + __typename: 'TableColumnConstraints'; + nullable: boolean; + unique: boolean; + other: Array; + }; + }>; + constraints: { + __typename: 'TableConstraints'; + other: Array; + } | null; + }; + } + | { + __typename: 'TextMetadataEntry'; + text: string; + label: string; + description: string | null; + } + | { + __typename: 'TimestampMetadataEntry'; + timestamp: number; + label: string; + description: string | null; + } + | { + __typename: 'UrlMetadataEntry'; + url: string; + label: string; + description: string | null; + } + >; + } + >; + }; + evaluationNodes: Array<{ + __typename: 'AutomationConditionEvaluationNode'; + uniqueId: string; + expandedLabel: Array; + userLabel: string | null; + startTimestamp: number | null; + endTimestamp: number | null; + numCandidates: number | null; + numTrue: number; + isPartitioned: boolean; + childUniqueIds: Array; + }>; + }>; + } + | {__typename: 'AutoMaterializeAssetEvaluationNeedsMigrationError'; message: string} + | null; +}; + +export type GetSlimEvaluationsQueryVariables = Types.Exact<{ + assetKey?: Types.InputMaybe; + assetCheckKey?: Types.InputMaybe; + limit: Types.Scalars['Int']['input']; + cursor?: Types.InputMaybe; +}>; + +export type GetSlimEvaluationsQuery = { + __typename: 'Query'; + assetConditionEvaluationRecordsOrError: + | { + __typename: 'AssetConditionEvaluationRecords'; + records: Array<{ + __typename: 'AssetConditionEvaluationRecord'; + id: string; + evaluationId: string; + numRequested: number; + runIds: Array; + timestamp: number; + startTimestamp: number | null; + endTimestamp: number | null; + isLegacy: boolean; + assetKey: {__typename: 'AssetKey'; path: Array} | null; evaluation: { __typename: 'AssetConditionEvaluation'; rootUniqueId: string; @@ -1546,6 +1974,8 @@ export type GetEvaluationsSpecificPartitionQuery = { } | null; }; -export const GetEvaluationsQueryVersion = '22cc08d87eec75cfec1f054f4d222b5a2478c47fc1a6788024d5902e3b7db197'; +export const GetEvaluationsQueryVersion = 'ffbe804f3dcaaf3923223096d1cd5cdd39773945fe75045d131e0144bee5c3d9'; + +export const GetSlimEvaluationsQueryVersion = '040bf5d6f79ce3c06d75f4410e5386df795c546f10d3180e3ee7cb3ddac949e3'; export const GetEvaluationsSpecificPartitionQueryVersion = '7c47ec6fee7ebf9edf6c5d57294f5a603e6a599884841eb211a1de9422c3791c'; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/useEvaluationsQueryResult.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/useEvaluationsQueryResult.tsx index c99e35f78995a..acdccd1de1406 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/useEvaluationsQueryResult.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/useEvaluationsQueryResult.tsx @@ -1,3 +1,5 @@ +import {useMemo} from 'react'; + import {GET_EVALUATIONS_QUERY} from './GetEvaluationsQuery'; import {GetEvaluationsQuery, GetEvaluationsQueryVariables} from './types/GetEvaluationsQuery.types'; import {useCursorPaginatedQuery} from '../../runs/useCursorPaginatedQuery'; @@ -7,7 +9,10 @@ export const PAGE_SIZE = 30; // This function exists mostly to use the return type later export function useEvaluationsQueryResult({assetKey}: {assetKey: AssetKey}) { - const result = useCursorPaginatedQuery({ + const {queryResult, paginationProps} = useCursorPaginatedQuery< + GetEvaluationsQuery, + GetEvaluationsQueryVariables + >({ nextCursorForResult: (data) => { if ( data.assetConditionEvaluationRecordsOrError?.__typename === @@ -32,5 +37,18 @@ export function useEvaluationsQueryResult({assetKey}: {assetKey: AssetKey}) { query: GET_EVALUATIONS_QUERY, pageSize: PAGE_SIZE, }); - return result; + + const {data} = queryResult; + const evaluations = useMemo(() => { + if ( + data?.assetConditionEvaluationRecordsOrError?.__typename === + 'AssetConditionEvaluationRecords' && + data?.assetNodeOrError?.__typename === 'AssetNode' + ) { + return data.assetConditionEvaluationRecordsOrError.records; + } + return []; + }, [data]); + + return {evaluations, queryResult, paginationProps}; } diff --git a/js_modules/dagster-ui/packages/ui-core/src/graphql/possibleTypes.generated.json b/js_modules/dagster-ui/packages/ui-core/src/graphql/possibleTypes.generated.json index 25046b8064e0f..07f601b122e6f 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/graphql/possibleTypes.generated.json +++ b/js_modules/dagster-ui/packages/ui-core/src/graphql/possibleTypes.generated.json @@ -1 +1 @@ -{"DisplayableEvent":["EngineEvent","ExecutionStepOutputEvent","ExpectationResult","FailureMetadata","HandledOutputEvent","LoadedInputEvent","ObjectStoreOperationResult","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","TypeCheck"],"MarkerEvent":["EngineEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent"],"ErrorEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepUpForRetryEvent","HookErroredEvent","RunCanceledEvent","RunFailureEvent","ResourceInitFailureEvent"],"MessageEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","LogMessageEvent","ObjectStoreOperationEvent","RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","AssetMaterializationPlannedEvent","LogsCapturedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"RunEvent":["RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","AssetMaterializationPlannedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent"],"PipelineRunStepStats":["RunStepStats"],"StepEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","ObjectStoreOperationEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"AssetOwner":["UserAssetOwner","TeamAssetOwner"],"AssetPartitionStatuses":["DefaultPartitionStatuses","MultiPartitionStatuses","TimePartitionStatuses"],"PartitionStatus1D":["TimePartitionStatuses","DefaultPartitionStatuses"],"AssetChecksOrError":["AssetChecks","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError"],"Instigator":["Schedule","Sensor"],"EvaluationStackEntry":["EvaluationStackListItemEntry","EvaluationStackPathEntry","EvaluationStackMapKeyEntry","EvaluationStackMapValueEntry"],"IPipelineSnapshot":["Pipeline","PipelineSnapshot","Job"],"PipelineConfigValidationError":["FieldNotDefinedConfigError","FieldsNotDefinedConfigError","MissingFieldConfigError","MissingFieldsConfigError","RuntimeMismatchConfigError","SelectorTypeConfigError"],"PipelineConfigValidationInvalid":["RunConfigValidationInvalid"],"PipelineConfigValidationResult":["InvalidSubsetError","PipelineConfigValidationValid","RunConfigValidationInvalid","PipelineNotFoundError","PythonError"],"PipelineReference":["PipelineSnapshot","UnknownPipeline"],"PipelineRun":["Run"],"DagsterRunEvent":["ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","ExecutionStepRestartEvent","LogMessageEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunFailureEvent","RunStartEvent","RunEnqueuedEvent","RunDequeuedEvent","RunStartingEvent","RunCancelingEvent","RunCanceledEvent","RunSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","HandledOutputEvent","LoadedInputEvent","LogsCapturedEvent","ObjectStoreOperationEvent","StepExpectationResultEvent","MaterializationEvent","ObservationEvent","EngineEvent","HookCompletedEvent","HookSkippedEvent","HookErroredEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetMaterializationPlannedEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"PipelineRunLogsSubscriptionPayload":["PipelineRunLogsSubscriptionSuccess","PipelineRunLogsSubscriptionFailure"],"RunOrError":["Run","RunNotFoundError","PythonError"],"PipelineRunStatsSnapshot":["RunStatsSnapshot"],"RunStatsSnapshotOrError":["RunStatsSnapshot","PythonError"],"PipelineSnapshotOrError":["PipelineNotFoundError","PipelineSnapshot","PipelineSnapshotNotFoundError","PythonError"],"RunsFeedEntry":["Run","PartitionBackfill"],"AssetOrError":["Asset","AssetNotFoundError"],"AssetsOrError":["AssetConnection","PythonError"],"DeletePipelineRunResult":["DeletePipelineRunSuccess","UnauthorizedError","PythonError","RunNotFoundError"],"ExecutionPlanOrError":["ExecutionPlan","RunConfigValidationInvalid","PipelineNotFoundError","InvalidSubsetError","PythonError"],"LaunchMultipleRunsResultOrError":["LaunchMultipleRunsResult","PythonError"],"PipelineOrError":["Pipeline","PipelineNotFoundError","InvalidSubsetError","PythonError"],"ReloadRepositoryLocationMutationResult":["WorkspaceLocationEntry","ReloadNotSupported","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"RepositoryLocationOrLoadError":["RepositoryLocation","PythonError"],"ReloadWorkspaceMutationResult":["Workspace","UnauthorizedError","PythonError"],"ShutdownRepositoryLocationMutationResult":["ShutdownRepositoryLocationSuccess","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"TerminatePipelineExecutionFailure":["TerminateRunFailure"],"TerminatePipelineExecutionSuccess":["TerminateRunSuccess"],"TerminateRunResult":["TerminateRunSuccess","TerminateRunFailure","RunNotFoundError","UnauthorizedError","PythonError"],"ScheduleMutationResult":["PythonError","UnauthorizedError","ScheduleStateResult","ScheduleNotFoundError"],"ScheduleOrError":["Schedule","ScheduleNotFoundError","PythonError"],"SchedulerOrError":["Scheduler","SchedulerNotDefinedError","PythonError"],"SchedulesOrError":["Schedules","RepositoryNotFoundError","PythonError"],"ScheduleTickSpecificData":["ScheduleTickSuccessData","ScheduleTickFailureData"],"LaunchBackfillResult":["LaunchBackfillSuccess","PartitionSetNotFoundError","PartitionKeysNotFoundError","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"ConfigTypeOrError":["EnumConfigType","CompositeConfigType","RegularConfigType","PipelineNotFoundError","ConfigTypeNotFoundError","PythonError"],"ConfigType":["ArrayConfigType","CompositeConfigType","EnumConfigType","NullableConfigType","RegularConfigType","ScalarUnionConfigType","MapConfigType"],"WrappingConfigType":["ArrayConfigType","NullableConfigType"],"DagsterType":["ListDagsterType","NullableDagsterType","RegularDagsterType"],"DagsterTypeOrError":["RegularDagsterType","PipelineNotFoundError","DagsterTypeNotFoundError","PythonError"],"WrappingDagsterType":["ListDagsterType","NullableDagsterType"],"Error":["AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError","PartitionKeysNotFoundError","AssetNotFoundError","ConflictingExecutionParamsError","ConfigTypeNotFoundError","DagsterTypeNotFoundError","InvalidPipelineRunsFilterError","InvalidSubsetError","ModeNotFoundError","NoModeProvidedError","PartitionSetNotFoundError","PipelineNotFoundError","RunConflict","PipelineSnapshotNotFoundError","PresetNotFoundError","PythonError","ErrorChainLink","UnauthorizedError","ReloadNotSupported","RepositoryLocationNotFound","RepositoryNotFoundError","ResourceNotFoundError","RunGroupNotFoundError","RunNotFoundError","ScheduleNotFoundError","SchedulerNotDefinedError","SensorNotFoundError","UnsupportedOperationError","DuplicateDynamicPartitionError","InstigationStateNotFoundError","SolidStepStatusUnavailableError","GraphNotFoundError","BackfillNotFoundError","PartitionSubsetDeserializationError","AutoMaterializeAssetEvaluationNeedsMigrationError"],"PipelineRunConflict":["RunConflict"],"PipelineRunNotFoundError":["RunNotFoundError"],"RepositoriesOrError":["RepositoryConnection","RepositoryNotFoundError","PythonError"],"RepositoryOrError":["PythonError","Repository","RepositoryNotFoundError"],"WorkspaceLocationEntryOrError":["WorkspaceLocationEntry","PythonError"],"InstigationTypeSpecificData":["SensorData","ScheduleData"],"InstigationStateOrError":["InstigationState","InstigationStateNotFoundError","PythonError"],"InstigationStatesOrError":["InstigationStates","PythonError"],"MetadataEntry":["TableColumnLineageMetadataEntry","TableSchemaMetadataEntry","TableMetadataEntry","FloatMetadataEntry","IntMetadataEntry","JsonMetadataEntry","BoolMetadataEntry","MarkdownMetadataEntry","PathMetadataEntry","NotebookMetadataEntry","PythonArtifactMetadataEntry","TextMetadataEntry","UrlMetadataEntry","PipelineRunMetadataEntry","AssetMetadataEntry","JobMetadataEntry","CodeReferencesMetadataEntry","NullMetadataEntry","TimestampMetadataEntry"],"SourceLocation":["LocalFileCodeReference","UrlCodeReference"],"PartitionRunConfigOrError":["PartitionRunConfig","PythonError"],"AssetBackfillStatus":["AssetPartitionsStatusCounts","UnpartitionedAssetStatus"],"PartitionSetOrError":["PartitionSet","PartitionSetNotFoundError","PythonError"],"PartitionSetsOrError":["PartitionSets","PipelineNotFoundError","PythonError"],"PartitionsOrError":["Partitions","PythonError"],"PartitionStatusesOrError":["PartitionStatuses","PythonError"],"PartitionTagsOrError":["PartitionTags","PythonError"],"RunConfigSchemaOrError":["RunConfigSchema","PipelineNotFoundError","InvalidSubsetError","ModeNotFoundError","PythonError"],"LaunchRunResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchRunReexecutionResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchPipelineRunSuccess":["LaunchRunSuccess"],"RunsOrError":["Runs","InvalidPipelineRunsFilterError","PythonError"],"PipelineRuns":["Runs"],"RunGroupOrError":["RunGroup","RunGroupNotFoundError","PythonError"],"SensorOrError":["Sensor","SensorNotFoundError","UnauthorizedError","PythonError"],"SensorsOrError":["Sensors","RepositoryNotFoundError","PythonError"],"StopSensorMutationResultOrError":["StopSensorMutationResult","UnauthorizedError","PythonError"],"ISolidDefinition":["CompositeSolidDefinition","SolidDefinition"],"SolidContainer":["Pipeline","PipelineSnapshot","Job","CompositeSolidDefinition","Graph"],"SolidStepStatsOrError":["SolidStepStatsConnection","SolidStepStatusUnavailableError"],"WorkspaceOrError":["Workspace","PythonError"],"WorkspaceLocationStatusEntriesOrError":["WorkspaceLocationStatusEntries","PythonError"],"ResourcesOrError":["ResourceConnection","PipelineNotFoundError","InvalidSubsetError","PythonError"],"GraphOrError":["Graph","GraphNotFoundError","PythonError"],"ResourceDetailsOrError":["ResourceDetails","ResourceNotFoundError","PythonError"],"ResourceDetailsListOrError":["ResourceDetailsList","RepositoryNotFoundError","PythonError"],"EnvVarWithConsumersOrError":["EnvVarWithConsumersList","PythonError"],"RunsFeedConnectionOrError":["RunsFeedConnection","PythonError"],"RunsFeedCountOrError":["RunsFeedCount","PythonError"],"RunTagKeysOrError":["PythonError","RunTagKeys"],"RunTagsOrError":["PythonError","RunTags"],"RunIdsOrError":["RunIds","InvalidPipelineRunsFilterError","PythonError"],"AssetNodeOrError":["AssetNode","AssetNotFoundError"],"PartitionBackfillOrError":["PartitionBackfill","BackfillNotFoundError","PythonError"],"PartitionBackfillsOrError":["PartitionBackfills","PythonError"],"EventConnectionOrError":["EventConnection","RunNotFoundError","PythonError"],"AutoMaterializeAssetEvaluationRecordsOrError":["AutoMaterializeAssetEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"PartitionKeysOrError":["PartitionKeys","PartitionSubsetDeserializationError"],"AutoMaterializeRuleEvaluationData":["TextRuleEvaluationData","ParentMaterializedRuleEvaluationData","WaitingOnKeysRuleEvaluationData"],"AssetConditionEvaluationNode":["UnpartitionedAssetConditionEvaluationNode","PartitionedAssetConditionEvaluationNode","SpecificPartitionAssetConditionEvaluationNode"],"AssetConditionEvaluationRecordsOrError":["AssetConditionEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"SensorDryRunResult":["PythonError","SensorNotFoundError","DryRunInstigationTick"],"ScheduleDryRunResult":["DryRunInstigationTick","PythonError","ScheduleNotFoundError"],"TerminateRunsResultOrError":["TerminateRunsResult","PythonError"],"AssetWipeMutationResult":["AssetNotFoundError","UnauthorizedError","PythonError","UnsupportedOperationError","AssetWipeSuccess"],"ReportRunlessAssetEventsResult":["UnauthorizedError","PythonError","ReportRunlessAssetEventsSuccess"],"ResumeBackfillResult":["ResumeBackfillSuccess","UnauthorizedError","PythonError"],"CancelBackfillResult":["CancelBackfillSuccess","UnauthorizedError","PythonError"],"LogTelemetryMutationResult":["LogTelemetrySuccess","PythonError"],"AddDynamicPartitionResult":["AddDynamicPartitionSuccess","UnauthorizedError","PythonError","DuplicateDynamicPartitionError"],"DeleteDynamicPartitionsResult":["DeleteDynamicPartitionsSuccess","UnauthorizedError","PythonError"]} \ No newline at end of file +{"DisplayableEvent":["EngineEvent","ExecutionStepOutputEvent","ExpectationResult","FailureMetadata","HandledOutputEvent","LoadedInputEvent","ObjectStoreOperationResult","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","TypeCheck"],"MarkerEvent":["EngineEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent"],"ErrorEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepUpForRetryEvent","HookErroredEvent","RunCanceledEvent","RunFailureEvent","ResourceInitFailureEvent"],"MessageEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","LogMessageEvent","ObjectStoreOperationEvent","RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","AssetMaterializationPlannedEvent","LogsCapturedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"RunEvent":["RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","AssetMaterializationPlannedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent"],"PipelineRunStepStats":["RunStepStats"],"StepEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","ObjectStoreOperationEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"AssetOwner":["UserAssetOwner","TeamAssetOwner"],"AssetPartitionStatuses":["DefaultPartitionStatuses","MultiPartitionStatuses","TimePartitionStatuses"],"PartitionStatus1D":["TimePartitionStatuses","DefaultPartitionStatuses"],"AssetChecksOrError":["AssetChecks","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError"],"Instigator":["Schedule","Sensor"],"EvaluationStackEntry":["EvaluationStackListItemEntry","EvaluationStackPathEntry","EvaluationStackMapKeyEntry","EvaluationStackMapValueEntry"],"IPipelineSnapshot":["Pipeline","PipelineSnapshot","Job"],"PipelineConfigValidationError":["FieldNotDefinedConfigError","FieldsNotDefinedConfigError","MissingFieldConfigError","MissingFieldsConfigError","RuntimeMismatchConfigError","SelectorTypeConfigError"],"PipelineConfigValidationInvalid":["RunConfigValidationInvalid"],"PipelineConfigValidationResult":["InvalidSubsetError","PipelineConfigValidationValid","RunConfigValidationInvalid","PipelineNotFoundError","PythonError"],"PipelineReference":["PipelineSnapshot","UnknownPipeline"],"PipelineRun":["Run"],"DagsterRunEvent":["ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","ExecutionStepRestartEvent","LogMessageEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunFailureEvent","RunStartEvent","RunEnqueuedEvent","RunDequeuedEvent","RunStartingEvent","RunCancelingEvent","RunCanceledEvent","RunSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","HandledOutputEvent","LoadedInputEvent","LogsCapturedEvent","ObjectStoreOperationEvent","StepExpectationResultEvent","MaterializationEvent","ObservationEvent","EngineEvent","HookCompletedEvent","HookSkippedEvent","HookErroredEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetMaterializationPlannedEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"PipelineRunLogsSubscriptionPayload":["PipelineRunLogsSubscriptionSuccess","PipelineRunLogsSubscriptionFailure"],"RunOrError":["Run","RunNotFoundError","PythonError"],"PipelineRunStatsSnapshot":["RunStatsSnapshot"],"RunStatsSnapshotOrError":["RunStatsSnapshot","PythonError"],"PipelineSnapshotOrError":["PipelineNotFoundError","PipelineSnapshot","PipelineSnapshotNotFoundError","PythonError"],"RunsFeedEntry":["Run","PartitionBackfill"],"AssetOrError":["Asset","AssetNotFoundError"],"AssetsOrError":["AssetConnection","PythonError"],"DeletePipelineRunResult":["DeletePipelineRunSuccess","UnauthorizedError","PythonError","RunNotFoundError"],"ExecutionPlanOrError":["ExecutionPlan","RunConfigValidationInvalid","PipelineNotFoundError","InvalidSubsetError","PythonError"],"LaunchMultipleRunsResultOrError":["LaunchMultipleRunsResult","PythonError"],"PipelineOrError":["Pipeline","PipelineNotFoundError","InvalidSubsetError","PythonError"],"ReloadRepositoryLocationMutationResult":["WorkspaceLocationEntry","ReloadNotSupported","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"RepositoryLocationOrLoadError":["RepositoryLocation","PythonError"],"ReloadWorkspaceMutationResult":["Workspace","UnauthorizedError","PythonError"],"ShutdownRepositoryLocationMutationResult":["ShutdownRepositoryLocationSuccess","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"TerminatePipelineExecutionFailure":["TerminateRunFailure"],"TerminatePipelineExecutionSuccess":["TerminateRunSuccess"],"TerminateRunResult":["TerminateRunSuccess","TerminateRunFailure","RunNotFoundError","UnauthorizedError","PythonError"],"ScheduleMutationResult":["PythonError","UnauthorizedError","ScheduleStateResult","ScheduleNotFoundError"],"ScheduleOrError":["Schedule","ScheduleNotFoundError","PythonError"],"SchedulerOrError":["Scheduler","SchedulerNotDefinedError","PythonError"],"SchedulesOrError":["Schedules","RepositoryNotFoundError","PythonError"],"ScheduleTickSpecificData":["ScheduleTickSuccessData","ScheduleTickFailureData"],"LaunchBackfillResult":["LaunchBackfillSuccess","PartitionSetNotFoundError","PartitionKeysNotFoundError","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"ConfigTypeOrError":["EnumConfigType","CompositeConfigType","RegularConfigType","PipelineNotFoundError","ConfigTypeNotFoundError","PythonError"],"ConfigType":["ArrayConfigType","CompositeConfigType","EnumConfigType","NullableConfigType","RegularConfigType","ScalarUnionConfigType","MapConfigType"],"WrappingConfigType":["ArrayConfigType","NullableConfigType"],"DagsterType":["ListDagsterType","NullableDagsterType","RegularDagsterType"],"DagsterTypeOrError":["RegularDagsterType","PipelineNotFoundError","DagsterTypeNotFoundError","PythonError"],"WrappingDagsterType":["ListDagsterType","NullableDagsterType"],"Error":["AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError","PartitionKeysNotFoundError","AssetNotFoundError","ConflictingExecutionParamsError","ConfigTypeNotFoundError","DagsterTypeNotFoundError","InvalidPipelineRunsFilterError","InvalidSubsetError","ModeNotFoundError","NoModeProvidedError","PartitionSetNotFoundError","PipelineNotFoundError","RunConflict","PipelineSnapshotNotFoundError","PresetNotFoundError","PythonError","ErrorChainLink","UnauthorizedError","ReloadNotSupported","RepositoryLocationNotFound","RepositoryNotFoundError","ResourceNotFoundError","RunGroupNotFoundError","RunNotFoundError","ScheduleNotFoundError","SchedulerNotDefinedError","SensorNotFoundError","UnsupportedOperationError","DuplicateDynamicPartitionError","InstigationStateNotFoundError","SolidStepStatusUnavailableError","GraphNotFoundError","BackfillNotFoundError","PartitionSubsetDeserializationError","AutoMaterializeAssetEvaluationNeedsMigrationError"],"PipelineRunConflict":["RunConflict"],"PipelineRunNotFoundError":["RunNotFoundError"],"RepositoriesOrError":["RepositoryConnection","RepositoryNotFoundError","PythonError"],"RepositoryOrError":["PythonError","Repository","RepositoryNotFoundError"],"WorkspaceLocationEntryOrError":["WorkspaceLocationEntry","PythonError"],"InstigationTypeSpecificData":["SensorData","ScheduleData"],"InstigationStateOrError":["InstigationState","InstigationStateNotFoundError","PythonError"],"InstigationStatesOrError":["InstigationStates","PythonError"],"MetadataEntry":["TableColumnLineageMetadataEntry","TableSchemaMetadataEntry","TableMetadataEntry","FloatMetadataEntry","IntMetadataEntry","JsonMetadataEntry","BoolMetadataEntry","MarkdownMetadataEntry","PathMetadataEntry","NotebookMetadataEntry","PythonArtifactMetadataEntry","TextMetadataEntry","UrlMetadataEntry","PipelineRunMetadataEntry","AssetMetadataEntry","JobMetadataEntry","CodeReferencesMetadataEntry","NullMetadataEntry","TimestampMetadataEntry"],"SourceLocation":["LocalFileCodeReference","UrlCodeReference"],"PartitionRunConfigOrError":["PartitionRunConfig","PythonError"],"AssetBackfillStatus":["AssetPartitionsStatusCounts","UnpartitionedAssetStatus"],"PartitionSetOrError":["PartitionSet","PartitionSetNotFoundError","PythonError"],"PartitionSetsOrError":["PartitionSets","PipelineNotFoundError","PythonError"],"PartitionsOrError":["Partitions","PythonError"],"PartitionStatusesOrError":["PartitionStatuses","PythonError"],"PartitionTagsOrError":["PartitionTags","PythonError"],"RunConfigSchemaOrError":["RunConfigSchema","PipelineNotFoundError","InvalidSubsetError","ModeNotFoundError","PythonError"],"LaunchRunResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchRunReexecutionResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchPipelineRunSuccess":["LaunchRunSuccess"],"RunsOrError":["Runs","InvalidPipelineRunsFilterError","PythonError"],"PipelineRuns":["Runs"],"RunGroupOrError":["RunGroup","RunGroupNotFoundError","PythonError"],"SensorOrError":["Sensor","SensorNotFoundError","UnauthorizedError","PythonError"],"SensorsOrError":["Sensors","RepositoryNotFoundError","PythonError"],"StopSensorMutationResultOrError":["StopSensorMutationResult","UnauthorizedError","PythonError"],"ISolidDefinition":["CompositeSolidDefinition","SolidDefinition"],"SolidContainer":["Pipeline","PipelineSnapshot","Job","CompositeSolidDefinition","Graph"],"SolidStepStatsOrError":["SolidStepStatsConnection","SolidStepStatusUnavailableError"],"WorkspaceOrError":["Workspace","PythonError"],"WorkspaceLocationStatusEntriesOrError":["WorkspaceLocationStatusEntries","PythonError"],"ResourcesOrError":["ResourceConnection","PipelineNotFoundError","InvalidSubsetError","PythonError"],"GraphOrError":["Graph","GraphNotFoundError","PythonError"],"ResourceDetailsOrError":["ResourceDetails","ResourceNotFoundError","PythonError"],"ResourceDetailsListOrError":["ResourceDetailsList","RepositoryNotFoundError","PythonError"],"EnvVarWithConsumersOrError":["EnvVarWithConsumersList","PythonError"],"RunsFeedConnectionOrError":["RunsFeedConnection","PythonError"],"RunsFeedCountOrError":["RunsFeedCount","PythonError"],"RunTagKeysOrError":["PythonError","RunTagKeys"],"RunTagsOrError":["PythonError","RunTags"],"RunIdsOrError":["RunIds","InvalidPipelineRunsFilterError","PythonError"],"AssetNodeOrError":["AssetNode","AssetNotFoundError"],"PartitionBackfillOrError":["PartitionBackfill","BackfillNotFoundError","PythonError"],"PartitionBackfillsOrError":["PartitionBackfills","PythonError"],"EventConnectionOrError":["EventConnection","RunNotFoundError","PythonError"],"AutoMaterializeAssetEvaluationRecordsOrError":["AutoMaterializeAssetEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"PartitionKeysOrError":["PartitionKeys","PartitionSubsetDeserializationError"],"AutoMaterializeRuleEvaluationData":["TextRuleEvaluationData","ParentMaterializedRuleEvaluationData","WaitingOnKeysRuleEvaluationData"],"AssetConditionEvaluationNode":["UnpartitionedAssetConditionEvaluationNode","PartitionedAssetConditionEvaluationNode","SpecificPartitionAssetConditionEvaluationNode"],"AssetConditionEvaluationRecordsOrError":["AssetConditionEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"EntityKey":["AssetKey","AssetCheckhandle"],"SensorDryRunResult":["PythonError","SensorNotFoundError","DryRunInstigationTick"],"ScheduleDryRunResult":["DryRunInstigationTick","PythonError","ScheduleNotFoundError"],"TerminateRunsResultOrError":["TerminateRunsResult","PythonError"],"AssetWipeMutationResult":["AssetNotFoundError","UnauthorizedError","PythonError","UnsupportedOperationError","AssetWipeSuccess"],"ReportRunlessAssetEventsResult":["UnauthorizedError","PythonError","ReportRunlessAssetEventsSuccess"],"ResumeBackfillResult":["ResumeBackfillSuccess","UnauthorizedError","PythonError"],"CancelBackfillResult":["CancelBackfillSuccess","UnauthorizedError","PythonError"],"LogTelemetryMutationResult":["LogTelemetrySuccess","PythonError"],"AddDynamicPartitionResult":["AddDynamicPartitionSuccess","UnauthorizedError","PythonError","DuplicateDynamicPartitionError"],"DeleteDynamicPartitionsResult":["DeleteDynamicPartitionsSuccess","UnauthorizedError","PythonError"]} \ No newline at end of file diff --git a/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql b/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql index 2f4c3193df0c9..11e6447c87c64 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql +++ b/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql @@ -899,6 +899,7 @@ type AssetCheck { canExecuteIndividually: AssetCheckCanExecuteIndividually! blocking: Boolean! additionalAssetKeys: [AssetKey!]! + automationCondition: AutomationCondition } type AssetCheckExecution { @@ -3365,7 +3366,7 @@ type Query { cursor: String ): AutoMaterializeAssetEvaluationRecordsOrError truePartitionsForAutomationConditionEvaluationNode( - assetKey: AssetKeyInput! + assetKey: AssetKeyInput evaluationId: ID! nodeUniqueId: String ): [String!]! @@ -3373,12 +3374,13 @@ type Query { evaluationId: ID! ): AutoMaterializeAssetEvaluationRecordsOrError assetConditionEvaluationForPartition( - assetKey: AssetKeyInput! + assetKey: AssetKeyInput evaluationId: ID! partition: String! ): AssetConditionEvaluation assetConditionEvaluationRecordsOrError( - assetKey: AssetKeyInput! + assetKey: AssetKeyInput + assetCheckKey: AssetCheckHandleInput limit: Int! cursor: String ): AssetConditionEvaluationRecordsOrError @@ -3689,7 +3691,8 @@ type AssetConditionEvaluationRecord { evaluationId: ID! runIds: [String!]! timestamp: Float! - assetKey: AssetKey! + assetKey: AssetKey + entityKey: EntityKey! numRequested: Int! startTimestamp: Float endTimestamp: Float @@ -3699,6 +3702,8 @@ type AssetConditionEvaluationRecord { evaluationNodes: [AutomationConditionEvaluationNode!]! } +union EntityKey = AssetKey | AssetCheckhandle + type AutomationConditionEvaluationNode { uniqueId: String! userLabel: String diff --git a/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts b/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts index ed57441d95d09..b351ec513ad28 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts @@ -146,6 +146,7 @@ export type AssetCheck = { __typename: 'AssetCheck'; additionalAssetKeys: Array; assetKey: AssetKey; + automationCondition: Maybe; blocking: Scalars['Boolean']['output']; canExecuteIndividually: AssetCheckCanExecuteIndividually; description: Maybe; @@ -299,8 +300,9 @@ export type AssetConditionEvaluationNode = export type AssetConditionEvaluationRecord = { __typename: 'AssetConditionEvaluationRecord'; - assetKey: AssetKey; + assetKey: Maybe; endTimestamp: Maybe; + entityKey: EntityKey; evaluation: AssetConditionEvaluation; evaluationId: Scalars['ID']['output']; evaluationNodes: Array; @@ -1257,6 +1259,8 @@ export type EngineEvent = DisplayableEvent & timestamp: Scalars['String']['output']; }; +export type EntityKey = AssetCheckhandle | AssetKey; + export type EnumConfigType = ConfigType & { __typename: 'EnumConfigType'; description: Maybe; @@ -3813,13 +3817,14 @@ export type QueryAssetCheckExecutionsArgs = { }; export type QueryAssetConditionEvaluationForPartitionArgs = { - assetKey: AssetKeyInput; + assetKey?: InputMaybe; evaluationId: Scalars['ID']['input']; partition: Scalars['String']['input']; }; export type QueryAssetConditionEvaluationRecordsOrErrorArgs = { - assetKey: AssetKeyInput; + assetCheckKey?: InputMaybe; + assetKey?: InputMaybe; cursor?: InputMaybe; limit: Scalars['Int']['input']; }; @@ -4040,7 +4045,7 @@ export type QueryTopLevelResourceDetailsOrErrorArgs = { }; export type QueryTruePartitionsForAutomationConditionEvaluationNodeArgs = { - assetKey: AssetKeyInput; + assetKey?: InputMaybe; evaluationId: Scalars['ID']['input']; nodeUniqueId?: InputMaybe; }; @@ -6001,6 +6006,12 @@ export const buildAssetCheck = ( : relationshipsToOmit.has('AssetKey') ? ({} as AssetKey) : buildAssetKey({}, relationshipsToOmit), + automationCondition: + overrides && overrides.hasOwnProperty('automationCondition') + ? overrides.automationCondition! + : relationshipsToOmit.has('AutomationCondition') + ? ({} as AutomationCondition) + : buildAutomationCondition({}, relationshipsToOmit), blocking: overrides && overrides.hasOwnProperty('blocking') ? overrides.blocking! : true, canExecuteIndividually: overrides && overrides.hasOwnProperty('canExecuteIndividually') @@ -6266,6 +6277,12 @@ export const buildAssetConditionEvaluationRecord = ( : buildAssetKey({}, relationshipsToOmit), endTimestamp: overrides && overrides.hasOwnProperty('endTimestamp') ? overrides.endTimestamp! : 4.33, + entityKey: + overrides && overrides.hasOwnProperty('entityKey') + ? overrides.entityKey! + : relationshipsToOmit.has('AssetCheckhandle') + ? ({} as AssetCheckhandle) + : buildAssetCheckhandle({}, relationshipsToOmit), evaluation: overrides && overrides.hasOwnProperty('evaluation') ? overrides.evaluation! diff --git a/js_modules/dagster-ui/packages/ui-core/src/instigation/TickMaterializationsTable.tsx b/js_modules/dagster-ui/packages/ui-core/src/instigation/TickMaterializationsTable.tsx index 3b52656d83bc5..1c903bfd21528 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/instigation/TickMaterializationsTable.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/instigation/TickMaterializationsTable.tsx @@ -204,7 +204,7 @@ const AssetDetailRow = ({ setIsOpen(false)} evaluationID={evaluationId} assetKeyPath={assetKey.path} /> diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/useCursorPaginatedQuery.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/useCursorPaginatedQuery.tsx index 736b147175069..9566bf88b15c4 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/useCursorPaginatedQuery.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/useCursorPaginatedQuery.tsx @@ -63,6 +63,7 @@ export function useCursorPaginatedQuery { diff --git a/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_checks.py b/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_checks.py index 799f6bd5ec3d7..0a0a224947ac7 100644 --- a/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_checks.py +++ b/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_checks.py @@ -10,10 +10,9 @@ from dagster._core.storage.asset_check_execution_record import AssetCheckExecutionRecordStatus from dagster._core.storage.dagster_run import RunRecord -from dagster_graphql.schema.asset_checks import GrapheneAssetCheckExecution - if TYPE_CHECKING: - from dagster_graphql.schema.pipelines.pipeline import GrapheneAssetCheckHandle + from dagster_graphql.schema.asset_checks import GrapheneAssetCheckExecution + from dagster_graphql.schema.entity_key import GrapheneAssetCheckHandle from dagster_graphql.schema.util import ResolveInfo @@ -32,7 +31,9 @@ def fetch_asset_check_executions( asset_check_key: AssetCheckKey, limit: int, cursor: Optional[str], -) -> List[GrapheneAssetCheckExecution]: +) -> List["GrapheneAssetCheckExecution"]: + from dagster_graphql.schema.asset_checks import GrapheneAssetCheckExecution + check_records = loading_context.instance.event_log_storage.get_asset_check_execution_history( check_key=asset_check_key, limit=limit, @@ -50,7 +51,7 @@ def fetch_asset_check_executions( def get_asset_checks_for_run_id( graphene_info: "ResolveInfo", run_id: str ) -> Sequence["GrapheneAssetCheckHandle"]: - from dagster_graphql.schema.pipelines.pipeline import GrapheneAssetCheckHandle + from dagster_graphql.schema.entity_key import GrapheneAssetCheckHandle check.str_param(run_id, "run_id") diff --git a/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_condition_evaluations.py b/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_condition_evaluations.py index 29d3eb286355d..e754b67658f43 100644 --- a/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_condition_evaluations.py +++ b/python_modules/dagster-graphql/dagster_graphql/implementation/fetch_asset_condition_evaluations.py @@ -1,7 +1,7 @@ -from typing import TYPE_CHECKING, Optional, Sequence +from typing import TYPE_CHECKING, Optional, Sequence, Union import dagster._check as check -from dagster import AssetKey +from dagster._core.definitions.asset_key import AssetCheckKey, AssetKey, EntityKey from dagster._core.scheduler.instigation import AutoMaterializeAssetEvaluationRecord from dagster_graphql.schema.asset_condition_evaluations import ( @@ -13,7 +13,7 @@ from dagster_graphql.schema.auto_materialize_asset_evaluations import ( GrapheneAutoMaterializeAssetEvaluationNeedsMigrationError, ) -from dagster_graphql.schema.inputs import GrapheneAssetKeyInput +from dagster_graphql.schema.inputs import GrapheneAssetCheckHandleInput, GrapheneAssetKeyInput if TYPE_CHECKING: from dagster_graphql.schema.util import ResolveInfo @@ -67,20 +67,29 @@ def fetch_asset_condition_evaluation_record_for_partition( ) +def entity_key_from_graphql_input( + graphene_input: Union[GrapheneAssetKeyInput, GrapheneAssetCheckHandleInput], +) -> EntityKey: + if "path" in graphene_input: + return AssetKey.from_graphql_input(graphene_input) + else: + return AssetCheckKey.from_graphql_input(graphene_input) + + def fetch_true_partitions_for_evaluation_node( graphene_info: "ResolveInfo", - graphene_asset_key: GrapheneAssetKeyInput, + graphene_entity_key: Union[GrapheneAssetKeyInput, GrapheneAssetCheckHandleInput], evaluation_id: int, node_unique_id: str, ) -> Sequence[str]: - asset_key = AssetKey.from_graphql_input(graphene_asset_key) + key = entity_key_from_graphql_input(graphene_entity_key) schedule_storage = check.not_none(graphene_info.context.instance.schedule_storage) record = next( iter( schedule_storage.get_auto_materialize_asset_evaluations( # there is no method to get a specific evaluation by id, so instead get the first # evaluation before evaluation_id + 1 - key=asset_key, + key=key, cursor=evaluation_id + 1, limit=1, ) @@ -104,7 +113,7 @@ def fetch_true_partitions_for_evaluation_node( def fetch_asset_condition_evaluation_records_for_asset_key( graphene_info: "ResolveInfo", - graphene_asset_key: GrapheneAssetKeyInput, + graphene_entity_key: Union[GrapheneAssetKeyInput, GrapheneAssetCheckHandleInput], limit: int, cursor: Optional[str], ) -> GrapheneAssetConditionEvaluationRecordsOrError: @@ -113,13 +122,13 @@ def fetch_asset_condition_evaluation_records_for_asset_key( if migration_error: return migration_error - asset_key = AssetKey.from_graphql_input(graphene_asset_key) + key = entity_key_from_graphql_input(graphene_entity_key) schedule_storage = check.not_none(graphene_info.context.instance.schedule_storage) return _get_graphene_records_from_evaluations( graphene_info, schedule_storage.get_auto_materialize_asset_evaluations( - key=asset_key, + key=key, limit=limit, cursor=int(cursor) if cursor else None, ), diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/__init__.py b/python_modules/dagster-graphql/dagster_graphql/schema/__init__.py index 7ad606e5f4c8c..b84cddd321d9e 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/__init__.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/__init__.py @@ -6,7 +6,6 @@ def types(): - from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.backfill import ( GrapheneLaunchBackfillResult, GrapheneLaunchBackfillSuccess, @@ -14,6 +13,7 @@ def types(): from dagster_graphql.schema.config_type_or_error import GrapheneConfigTypeOrError from dagster_graphql.schema.config_types import types as config_types from dagster_graphql.schema.dagster_types import types as dagster_types_types + from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import types as errors_types from dagster_graphql.schema.execution import types as execution_types from dagster_graphql.schema.external import types as external_types diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/asset_checks.py b/python_modules/dagster-graphql/dagster_graphql/schema/asset_checks.py index ca864bc4fa98b..ac14762b2ccfc 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_checks.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/asset_checks.py @@ -7,8 +7,11 @@ AssetCheckEvaluation, AssetCheckEvaluationTargetMaterializationData, ) -from dagster._core.definitions.asset_check_spec import AssetCheckKey, AssetCheckSeverity +from dagster._core.definitions.asset_check_spec import AssetCheckSeverity from dagster._core.definitions.asset_key import AssetKey +from dagster._core.definitions.declarative_automation.serialized_objects import ( + AutomationConditionSnapshot, +) from dagster._core.definitions.remote_asset_graph import RemoteAssetCheckNode from dagster._core.events import DagsterEventType from dagster._core.storage.asset_check_execution_record import ( @@ -17,7 +20,9 @@ ) from dagster_graphql.implementation.events import iterate_metadata_entries -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.auto_materialize_policy import GrapheneAutoMaterializePolicy +from dagster_graphql.schema.automation_condition import GrapheneAutomationCondition +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import GrapheneError from dagster_graphql.schema.metadata import GrapheneMetadataEntry from dagster_graphql.schema.util import ResolveInfo, non_null_list @@ -134,6 +139,7 @@ class GrapheneAssetCheck(graphene.ObjectType): canExecuteIndividually = graphene.NonNull(GrapheneAssetCheckCanExecuteIndividually) blocking = graphene.NonNull(graphene.Boolean) additionalAssetKeys = non_null_list(GrapheneAssetKey) + automationCondition = graphene.Field(GrapheneAutomationCondition) class Meta: name = "AssetCheck" @@ -185,6 +191,22 @@ def resolve_additionalAssetKeys(self, _) -> Sequence[GrapheneAssetKey]: for asset_key in self._asset_check.additional_asset_keys ] + def resolve_automationCondition( + self, _graphene_info: ResolveInfo + ) -> Optional[GrapheneAutoMaterializePolicy]: + automation_condition = ( + self._asset_check.automation_condition_snapshot + or self._asset_check.automation_condition + ) + if automation_condition: + return GrapheneAutomationCondition( + # we only store one of automation_condition or automation_condition_snapshot + automation_condition + if isinstance(automation_condition, AutomationConditionSnapshot) + else automation_condition.get_snapshot() + ) + return None + class GrapheneAssetChecks(graphene.ObjectType): checks = non_null_list(GrapheneAssetCheck) @@ -234,14 +256,3 @@ class Meta: GrapheneAssetCheckNeedsAgentUpgradeError, ) name = "AssetChecksOrError" - - -class GrapheneAssetCheckHandle(graphene.ObjectType): - name = graphene.NonNull(graphene.String) - assetKey = graphene.NonNull(GrapheneAssetKey) - - class Meta: - name = "AssetCheckhandle" - - def __init__(self, handle: AssetCheckKey): - super().__init__(name=handle.name, assetKey=GrapheneAssetKey(path=handle.asset_key.path)) diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/asset_condition_evaluations.py b/python_modules/dagster-graphql/dagster_graphql/schema/asset_condition_evaluations.py index d5626cc10c1e4..5e522a5b8077f 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_condition_evaluations.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/asset_condition_evaluations.py @@ -4,6 +4,7 @@ import graphene from dagster._core.asset_graph_view.serializable_entity_subset import SerializableEntitySubset +from dagster._core.definitions.asset_key import AssetKey from dagster._core.definitions.declarative_automation.serialized_objects import ( AutomationConditionEvaluation, AutomationConditionSnapshot, @@ -11,10 +12,10 @@ from dagster._core.scheduler.instigation import AutoMaterializeAssetEvaluationRecord from dagster_graphql.implementation.events import iterate_metadata_entries -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.auto_materialize_asset_evaluations import ( GrapheneAutoMaterializeAssetEvaluationNeedsMigrationError, ) +from dagster_graphql.schema.entity_key import GrapheneAssetKey, GrapheneEntityKey from dagster_graphql.schema.metadata import GrapheneMetadataEntry from dagster_graphql.schema.util import ResolveInfo, non_null_list @@ -251,7 +252,8 @@ class GrapheneAssetConditionEvaluationRecord(graphene.ObjectType): runIds = non_null_list(graphene.String) timestamp = graphene.NonNull(graphene.Float) - assetKey = graphene.NonNull(GrapheneAssetKey) + assetKey = graphene.Field(GrapheneAssetKey) + entityKey = graphene.NonNull(GrapheneEntityKey) numRequested = graphene.NonNull(graphene.Int) startTimestamp = graphene.Field(graphene.Float) @@ -282,7 +284,10 @@ def __init__( evaluationId=record.evaluation_id, timestamp=record.timestamp, runIds=evaluation_with_run_ids.run_ids, - assetKey=GrapheneAssetKey(path=record.key.path), + assetKey=GrapheneEntityKey.from_entity_key(record.key) + if isinstance(record.key, AssetKey) + else None, + entityKey=GrapheneEntityKey.from_entity_key(record.key), numRequested=root_evaluation.true_subset.size, startTimestamp=root_evaluation.start_timestamp, endTimestamp=root_evaluation.end_timestamp, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py b/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py index 4b59f18050e30..6473b7e1bbed3 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py @@ -61,7 +61,6 @@ GrapheneAssetChecks, GrapheneAssetChecksOrError, ) -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.auto_materialize_policy import GrapheneAutoMaterializePolicy from dagster_graphql.schema.automation_condition import GrapheneAutomationCondition from dagster_graphql.schema.backfill import GrapheneBackfillPolicy @@ -73,6 +72,7 @@ GrapheneRegularDagsterType, to_dagster_type, ) +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import GrapheneAssetNotFoundError from dagster_graphql.schema.freshness_policy import ( GrapheneAssetFreshnessInfo, @@ -839,7 +839,7 @@ def resolve_autoMaterializePolicy( def resolve_automationCondition( self, _graphene_info: ResolveInfo - ) -> Optional[GrapheneAutoMaterializePolicy]: + ) -> Optional[GrapheneAutomationCondition]: automation_condition = ( self._asset_node_snap.automation_condition_snapshot or self._asset_node_snap.automation_condition diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/asset_key.py b/python_modules/dagster-graphql/dagster_graphql/schema/asset_key.py deleted file mode 100644 index d0945dc669b24..0000000000000 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_key.py +++ /dev/null @@ -1,18 +0,0 @@ -import graphene - -from dagster_graphql.schema.util import non_null_list - - -class GrapheneAssetKey(graphene.ObjectType): - path = non_null_list(graphene.String) - - class Meta: - name = "AssetKey" - - -class GrapheneAssetLineageInfo(graphene.ObjectType): - assetKey = graphene.NonNull(GrapheneAssetKey) - partitions = non_null_list(graphene.String) - - class Meta: - name = "AssetLineageInfo" diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/asset_selections.py b/python_modules/dagster-graphql/dagster_graphql/schema/asset_selections.py index d380a35922e03..eb913c1692829 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_selections.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/asset_selections.py @@ -7,7 +7,7 @@ from dagster_graphql.implementation.fetch_assets import get_asset from dagster_graphql.implementation.utils import capture_error -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.util import ResolveInfo, non_null_list if TYPE_CHECKING: diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/auto_materialize_asset_evaluations.py b/python_modules/dagster-graphql/dagster_graphql/schema/auto_materialize_asset_evaluations.py index d1e9c4d7f0025..a52bc5d44d4b1 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/auto_materialize_asset_evaluations.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/auto_materialize_asset_evaluations.py @@ -10,8 +10,8 @@ from dagster._core.definitions.metadata import DagsterAssetMetadataValue from dagster._core.scheduler.instigation import AutoMaterializeAssetEvaluationRecord -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.auto_materialize_policy import GrapheneAutoMaterializeRule +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import GrapheneError from dagster_graphql.schema.partition_keys import ( GraphenePartitionKeys, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/backfill.py b/python_modules/dagster-graphql/dagster_graphql/schema/backfill.py index 81aba8d6a52e6..56549667aab45 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/backfill.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/backfill.py @@ -33,7 +33,7 @@ partition_statuses_from_run_partition_data, ) from dagster_graphql.implementation.utils import has_permission_for_asset_graph -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import ( GrapheneError, GrapheneInvalidOutputError, @@ -383,7 +383,7 @@ class Meta: description="Included to comply with RunsFeedEntry interface.", ) assetCheckSelection = graphene.List( - graphene.NonNull("dagster_graphql.schema.asset_checks.GrapheneAssetCheckHandle") + graphene.NonNull("dagster_graphql.schema.entity_key.GrapheneAssetCheckHandle") ) def __init__(self, backfill_job: PartitionBackfill): diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/entity_key.py b/python_modules/dagster-graphql/dagster_graphql/schema/entity_key.py new file mode 100644 index 0000000000000..a1e9696511eb8 --- /dev/null +++ b/python_modules/dagster-graphql/dagster_graphql/schema/entity_key.py @@ -0,0 +1,44 @@ +import graphene +from dagster._core.definitions.asset_check_spec import AssetCheckKey +from dagster._core.definitions.asset_key import AssetKey, EntityKey + +from dagster_graphql.schema.util import non_null_list + + +class GrapheneAssetKey(graphene.ObjectType): + path = non_null_list(graphene.String) + + class Meta: + name = "AssetKey" + + +class GrapheneAssetCheckHandle(graphene.ObjectType): + name = graphene.NonNull(graphene.String) + assetKey = graphene.NonNull(GrapheneAssetKey) + + class Meta: + name = "AssetCheckhandle" + + def __init__(self, handle: AssetCheckKey): + super().__init__(name=handle.name, assetKey=GrapheneAssetKey(path=handle.asset_key.path)) + + +class GrapheneEntityKey(graphene.Union): + class Meta: + name = "EntityKey" + types = (GrapheneAssetKey, GrapheneAssetCheckHandle) + + @staticmethod + def from_entity_key(key: EntityKey) -> "GrapheneEntityKey": + if isinstance(key, AssetKey): + return GrapheneAssetKey(path=key.path) + else: + return GrapheneAssetCheckHandle(handle=key) + + +class GrapheneAssetLineageInfo(graphene.ObjectType): + assetKey = graphene.NonNull(GrapheneAssetKey) + partitions = non_null_list(graphene.String) + + class Meta: + name = "AssetLineageInfo" diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py b/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py index e58cc9b863cae..26005c6708c6a 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py @@ -33,7 +33,7 @@ from dagster_graphql.implementation.fetch_ticks import get_instigation_ticks from dagster_graphql.implementation.loader import RepositoryScopedBatchLoader from dagster_graphql.implementation.utils import UserFacingGraphQLError -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import ( GrapheneError, GraphenePythonError, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/logs/events.py b/python_modules/dagster-graphql/dagster_graphql/schema/logs/events.py index 46a1dbc8bf0e2..0014e2051980a 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/logs/events.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/logs/events.py @@ -11,7 +11,7 @@ from dagster_graphql.implementation.events import construct_basic_params from dagster_graphql.implementation.fetch_runs import gen_run_by_id, get_step_stats from dagster_graphql.schema.asset_checks import GrapheneAssetCheckEvaluation -from dagster_graphql.schema.asset_key import GrapheneAssetKey, GrapheneAssetLineageInfo +from dagster_graphql.schema.entity_key import GrapheneAssetKey, GrapheneAssetLineageInfo from dagster_graphql.schema.errors import GraphenePythonError, GrapheneRunNotFoundError from dagster_graphql.schema.logs.log_level import GrapheneLogLevel from dagster_graphql.schema.metadata import GrapheneMetadataEntry diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/metadata.py b/python_modules/dagster-graphql/dagster_graphql/schema/metadata.py index dfcec93939e13..2e5fa989f7f0d 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/metadata.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/metadata.py @@ -1,6 +1,6 @@ import graphene -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.table import ( GrapheneTable, GrapheneTableColumnLineageEntry, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/partition_sets.py b/python_modules/dagster-graphql/dagster_graphql/schema/partition_sets.py index 6610edfd4fcf4..3b20c41fbf330 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/partition_sets.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/partition_sets.py @@ -29,8 +29,8 @@ ) from dagster_graphql.implementation.fetch_runs import get_runs from dagster_graphql.implementation.utils import capture_error -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.backfill import GraphenePartitionBackfill +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import ( GrapheneDuplicateDynamicPartitionError, GraphenePartitionSetNotFoundError, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/pipelines/pipeline.py b/python_modules/dagster-graphql/dagster_graphql/schema/pipelines/pipeline.py index be0b522e2da82..22f4e32623dda 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/pipelines/pipeline.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/pipelines/pipeline.py @@ -36,14 +36,13 @@ apply_cursor_limit_reverse, capture_error, ) -from dagster_graphql.schema.asset_checks import GrapheneAssetCheckHandle -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.dagster_types import ( GrapheneDagsterType, GrapheneDagsterTypeOrError, GrapheneDagsterTypeUnion, to_dagster_type, ) +from dagster_graphql.schema.entity_key import GrapheneAssetCheckHandle, GrapheneAssetKey from dagster_graphql.schema.errors import ( GrapheneDagsterTypeNotFoundError, GraphenePythonError, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/resources.py b/python_modules/dagster-graphql/dagster_graphql/schema/resources.py index b6b942fe17458..43946513601dd 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/resources.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/resources.py @@ -11,8 +11,8 @@ ResourceValueSnap, ) -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.config_types import GrapheneConfigTypeField +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import ( GraphenePythonError, GrapheneRepositoryNotFoundError, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py b/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py index 31d51fc9be512..24d67095948e4 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py @@ -44,13 +44,13 @@ pipeline_selector_from_graphql, require_permission_check, ) -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.backfill import ( GrapheneAssetPartitionRange, GrapheneCancelBackfillResult, GrapheneLaunchBackfillResult, GrapheneResumeBackfillResult, ) +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import ( GrapheneAssetNotFoundError, GrapheneConflictingExecutionParamsError, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py b/python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py index 48a244bee6457..d50d810915e62 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py @@ -103,7 +103,6 @@ GrapheneAssetConditionEvaluationRecordsOrError, ) from dagster_graphql.schema.asset_graph import ( - GrapheneAssetKey, GrapheneAssetLatestInfo, GrapheneAssetNode, GrapheneAssetNodeDefinitionCollision, @@ -118,6 +117,7 @@ GraphenePartitionBackfillOrError, GraphenePartitionBackfillsOrError, ) +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.env_vars import GrapheneEnvVarWithConsumersListOrError from dagster_graphql.schema.external import ( GrapheneRepositoriesOrError, @@ -129,6 +129,7 @@ ) from dagster_graphql.schema.inputs import ( GrapheneAssetBackfillPreviewParams, + GrapheneAssetCheckHandleInput, GrapheneAssetGroupSelector, GrapheneAssetKeyInput, GrapheneBulkActionsFilter, @@ -578,7 +579,7 @@ class Meta: truePartitionsForAutomationConditionEvaluationNode = graphene.Field( non_null_list(graphene.String), - assetKey=graphene.Argument(graphene.NonNull(GrapheneAssetKeyInput)), + assetKey=graphene.Argument(GrapheneAssetKeyInput), evaluationId=graphene.Argument(graphene.NonNull(graphene.ID)), nodeUniqueId=graphene.Argument(graphene.String), description="Retrieve the partition keys which were true for a specific automation condition evaluation node.", @@ -594,7 +595,7 @@ class Meta: assetConditionEvaluationForPartition = graphene.Field( GrapheneAssetConditionEvaluation, - assetKey=graphene.Argument(graphene.NonNull(GrapheneAssetKeyInput)), + assetKey=graphene.Argument(GrapheneAssetKeyInput), evaluationId=graphene.Argument(graphene.NonNull(graphene.ID)), partition=graphene.Argument(graphene.NonNull(graphene.String)), description="Retrieve the condition evaluation for an asset and partition.", @@ -602,7 +603,8 @@ class Meta: assetConditionEvaluationRecordsOrError = graphene.Field( GrapheneAssetConditionEvaluationRecordsOrError, - assetKey=graphene.Argument(graphene.NonNull(GrapheneAssetKeyInput)), + assetKey=graphene.Argument(GrapheneAssetKeyInput), + assetCheckKey=graphene.Argument(GrapheneAssetCheckHandleInput, required=False), limit=graphene.Argument(graphene.NonNull(graphene.Int)), cursor=graphene.Argument(graphene.String), description="Retrieve the condition evaluation records for an asset.", @@ -1269,7 +1271,7 @@ def resolve_autoMaterializeEvaluationsForEvaluationId( def resolve_assetConditionEvaluationForPartition( self, graphene_info: ResolveInfo, - assetKey: GrapheneAssetKeyInput, + assetKey: Optional[GrapheneAssetKeyInput], evaluationId: str, partition: str, ): @@ -1283,13 +1285,14 @@ def resolve_assetConditionEvaluationForPartition( def resolve_assetConditionEvaluationRecordsOrError( self, graphene_info: ResolveInfo, - assetKey: GrapheneAssetKeyInput, + assetKey: Optional[GrapheneAssetKeyInput], limit: int, cursor: Optional[str] = None, + assetCheckKey: Optional[GrapheneAssetCheckHandleInput] = None, ): return fetch_asset_condition_evaluation_records_for_asset_key( graphene_info=graphene_info, - graphene_asset_key=assetKey, + graphene_entity_key=check.not_none(assetKey or assetCheckKey), cursor=cursor, limit=limit, ) @@ -1297,13 +1300,13 @@ def resolve_assetConditionEvaluationRecordsOrError( def resolve_truePartitionsForAutomationConditionEvaluationNode( self, graphene_info: ResolveInfo, - assetKey: GrapheneAssetKeyInput, + assetKey: Optional[GrapheneAssetKeyInput], evaluationId: str, nodeUniqueId: str, ): return fetch_true_partitions_for_evaluation_node( graphene_info=graphene_info, - graphene_asset_key=assetKey, + graphene_entity_key=assetKey, evaluation_id=int(evaluationId), node_unique_id=nodeUniqueId, ) diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/runs_feed.py b/python_modules/dagster-graphql/dagster_graphql/schema/runs_feed.py index 112ee46f89a03..73dfee2e3e8eb 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/runs_feed.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/runs_feed.py @@ -1,6 +1,6 @@ import graphene -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import GraphenePythonError from dagster_graphql.schema.util import non_null_list @@ -15,7 +15,7 @@ class GrapheneRunsFeedEntry(graphene.Interface): jobName = graphene.String() assetSelection = graphene.List(graphene.NonNull(GrapheneAssetKey)) assetCheckSelection = graphene.List( - graphene.NonNull("dagster_graphql.schema.asset_checks.GrapheneAssetCheckHandle") + graphene.NonNull("dagster_graphql.schema.entity_key.GrapheneAssetCheckHandle") ) class Meta: diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/sensors.py b/python_modules/dagster-graphql/dagster_graphql/schema/sensors.py index 627565bfb80c7..8cefee63c4a79 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/sensors.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/sensors.py @@ -25,8 +25,8 @@ capture_error, require_permission_check, ) -from dagster_graphql.schema.asset_key import GrapheneAssetKey from dagster_graphql.schema.asset_selections import GrapheneAssetSelection +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.errors import ( GraphenePythonError, GrapheneRepositoryNotFoundError, diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/table.py b/python_modules/dagster-graphql/dagster_graphql/schema/table.py index 08d1e6e22b645..472071dbe7aa3 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/table.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/table.py @@ -3,7 +3,7 @@ import graphene from dagster._core.definitions.metadata.table import TableColumn -from dagster_graphql.schema.asset_key import GrapheneAssetKey +from dagster_graphql.schema.entity_key import GrapheneAssetKey from dagster_graphql.schema.tags import GrapheneDefinitionTag from dagster_graphql.schema.util import non_null_list diff --git a/python_modules/libraries/dagster-components/dagster_components/core/component_generator.py b/python_modules/libraries/dagster-components/dagster_components/core/component_generator.py new file mode 100644 index 0000000000000..7535c24cf46b9 --- /dev/null +++ b/python_modules/libraries/dagster-components/dagster_components/core/component_generator.py @@ -0,0 +1 @@ +class ComponentGenerator: ...
Timestamp Evaluation result