From abb01880325f414e0a90fc60feabadbc8bce15b6 Mon Sep 17 00:00:00 2001 From: gibsondan Date: Thu, 31 Oct 2024 16:07:34 -0500 Subject: [PATCH] BigInt => ID in asset evaluations (#25673) ## Summary & Motivation ## How I Tested These Changes ## Changelog > Insert changelog entry or delete this section. --- .../dagster-ui/packages/ui-core/client.json | 4 +-- .../AssetAutomaterializePolicyPage.tsx | 5 ++-- .../AutomaterializeMiddlePanel.tsx | 4 +-- .../GetEvaluationsQuery.tsx | 2 +- .../PartitionSegmentWithPopover.tsx | 2 +- .../PartitionSubsetList.tsx | 2 +- .../PartitionSubsetListQuery.tsx | 2 +- .../PolicyEvaluationTable.tsx | 6 ++-- .../AutoMaterializePolicyPage.fixtures.ts | 20 ++++++------- .../PartitionSegmentWithPopover.fixtures.ts | 2 +- .../PolicyEvaluationTable.stories.tsx | 8 +++--- .../__tests__/PolicyEvaluationTable.test.tsx | 10 +++---- .../AutoMaterializePolicyPage/types.tsx | 2 +- .../types/GetEvaluationsQuery.types.ts | 8 +++--- .../types/PartitionSubsetListQuery.types.ts | 4 +-- .../useEvaluationsQueryResult.tsx | 4 +-- .../types/AssetDaemonTicksQuery.types.ts | 4 +-- .../ui-core/src/graphql/schema.graphql | 20 ++++++------- .../packages/ui-core/src/graphql/types.ts | 28 +++++++++++-------- .../instigation/TickMaterializationsTable.tsx | 2 +- .../types/TickDetailsDialog.types.ts | 2 +- .../types/AssetSensorTicksQuery.types.ts | 2 +- .../schema/asset_condition_evaluations.py | 2 +- .../dagster_graphql/schema/asset_graph.py | 2 +- .../auto_materialize_asset_evaluations.py | 2 +- .../dagster_graphql/schema/instigation.py | 2 +- .../dagster_graphql/schema/roots/query.py | 16 +++++------ .../test_asset_condition_evaluations.py | 21 +++++++------- 28 files changed, 94 insertions(+), 94 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-core/client.json b/js_modules/dagster-ui/packages/ui-core/client.json index 557d8a912a993..9f4460e9ded40 100644 --- a/js_modules/dagster-ui/packages/ui-core/client.json +++ b/js_modules/dagster-ui/packages/ui-core/client.json @@ -22,8 +22,8 @@ "RunStatusOnlyQuery": "e0000c8f2600dbe29f305febb04cca005e08da6a7ce03ec20476c59d607495c0", "AutomaterializeRunsQuery": "213e0a8e4d88de599b4740ba7d0d4bfac14defebcc8f3813eecc13696b9f17d9", "GetEvaluationsQuery": "fb2fadc8e0c982926deb90a3889f2b705bb340a98ade6a7e28175cfa10e5a1b8", - "GetEvaluationsSpecificPartitionQuery": "d753be21aeea04a8cb0fa20e6933463ca16c19413df0741bd94b5a06dd8d1de7", - "PartitionSubsetListQuery": "2c8c8f7bd10e0be6ef37e833057c78ca202b23f0bc89dafe4e8a12389e3fe2b8", + "GetEvaluationsSpecificPartitionQuery": "fa9ed1faccad8a56180a76f841073f554b98c1a8f46b6d9bf1ae6f9d7d632398", + "PartitionSubsetListQuery": "9a560790b6c1828137f31532f5879cfb6611d9ca8c14b7f315464510b6a4bd75", "AutoMaterializeSensorFlag": "961162c030e7e3c35be91db37c1990ad31b53cb8225d216fece2bdc2a6210bce", "BackfillPreviewQuery": "21a636242bab27144e5627361658207b708cc3e60c149f8901e476c3d9d0b021", "AssetStaleStatusQuery": "2c0792a380368dfd0b6c892bd7c18f86bb34e599a2f8b020852b4a6285defa37", 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 3c67ba141b4e6..70b3570890991 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 @@ -43,12 +43,11 @@ export const AssetAutomaterializePolicyPage = ({ const isFirstPage = !paginationProps.hasPrevCursor; const [selectedEvaluationId, setSelectedEvaluationId] = useQueryPersistedState< - number | undefined + string | undefined >({ queryKey: 'evaluation', decode: (raw) => { - const value = parseInt(raw.evaluation); - return isNaN(value) ? undefined : value; + return raw.evaluation; }, encode: (raw) => { // Reset the selected partition diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx index e2d9c1196c330..4b6e128d0b5a6 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx @@ -25,7 +25,7 @@ import {AssetViewDefinitionNodeFragment} from '../types/AssetView.types'; interface Props { assetKey: AssetKey; - selectedEvaluationId: number | undefined; + selectedEvaluationId: string | undefined; selectedEvaluation?: AssetConditionEvaluationRecordFragment; definition?: AssetViewDefinitionNodeFragment | null; } @@ -55,7 +55,7 @@ export const AutomaterializeMiddlePanel = (props: Props) => { { variables: { assetKey, - cursor: selectedEvaluationId ? `${selectedEvaluationId + 1}` : undefined, + cursor: selectedEvaluationId ? `${BigInt(selectedEvaluationId) + 1n}` : undefined, limit: 2, }, skip, diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/GetEvaluationsQuery.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/GetEvaluationsQuery.tsx index 76e49240016c8..4dd830f421eee 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/GetEvaluationsQuery.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/GetEvaluationsQuery.tsx @@ -121,7 +121,7 @@ export const GET_EVALUATIONS_QUERY = gql` export const GET_EVALUATIONS_SPECIFIC_PARTITION_QUERY = gql` query GetEvaluationsSpecificPartitionQuery( $assetKey: AssetKeyInput! - $evaluationId: BigInt! + $evaluationId: ID! $partition: String! ) { assetConditionEvaluationForPartition( diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSegmentWithPopover.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSegmentWithPopover.tsx index 8b419dc0c3281..492b70ad6684b 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSegmentWithPopover.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSegmentWithPopover.tsx @@ -8,7 +8,7 @@ interface Props { description: string; numTrue: number; assetKeyPath: string[]; - evaluationId: number; + evaluationId: string; nodeUniqueId: string; selectPartition?: (partitionKey: string | null) => void; } diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetList.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetList.tsx index 689909946b70d..1f5527acc6b72 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetList.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetList.tsx @@ -26,7 +26,7 @@ interface Props { description: string; status?: AssetConditionEvaluationStatus; assetKeyPath: string[]; - evaluationId: number; + evaluationId: string; nodeUniqueId: string; selectPartition?: (partitionKey: string | null) => void; } diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetListQuery.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetListQuery.tsx index 12b06e79d2387..9b8ccf2930b29 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetListQuery.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PartitionSubsetListQuery.tsx @@ -3,7 +3,7 @@ import {gql} from '../../apollo-client'; export const PARTITION_SUBSET_LIST_QUERY = gql` query PartitionSubsetListQuery( $assetKey: AssetKeyInput! - $evaluationId: BigInt! + $evaluationId: ID! $nodeUniqueId: String! ) { truePartitionsForAutomationConditionEvaluationNode( diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PolicyEvaluationTable.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PolicyEvaluationTable.tsx index 96333a1370072..c6cdabb4755b9 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PolicyEvaluationTable.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/PolicyEvaluationTable.tsx @@ -22,7 +22,7 @@ import {AssetEventMetadataEntriesTable} from '../AssetEventMetadataEntriesTable' interface Props { assetKeyPath: string[] | null; evaluationNodes: Evaluation[]; - evaluationId: number; + evaluationId: string; rootUniqueId: string; isLegacyEvaluation: boolean; selectPartition: (partitionKey: string | null) => void; @@ -111,7 +111,7 @@ const NewPolicyEvaluationTable = ({ toggleExpanded, }: { assetKeyPath: string[] | null; - evaluationId: number; + evaluationId: string; expandedRecords: Set; toggleExpanded: (id: string) => void; flattenedRecords: FlattenedConditionEvaluation[]; @@ -343,7 +343,7 @@ export const PartitionedPolicyEvaluationTable = ({ selectPartition, }: { assetKeyPath: string[] | null; - evaluationId: number; + evaluationId: string; rootUniqueId: string; flattenedRecords: FlattenedConditionEvaluation[]; expandedRecords: Set; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/AutoMaterializePolicyPage.fixtures.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/AutoMaterializePolicyPage.fixtures.ts index af636674f8688..07093e193bde9 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/AutoMaterializePolicyPage.fixtures.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/AutoMaterializePolicyPage.fixtures.ts @@ -66,7 +66,7 @@ export const buildGetEvaluationsQuery = ({ const ONE_MINUTE = 1000 * 60; -export const TEST_EVALUATION_ID = 27; +export const TEST_EVALUATION_ID = '27'; export const buildEvaluationRecordsWithPartitions = () => { const now = Date.now(); @@ -84,37 +84,37 @@ export const buildEvaluationRecordsWithPartitions = () => { }), buildAssetConditionEvaluationRecord({ id: 'f', - evaluationId: 24, + evaluationId: '24', timestamp: (now - ONE_MINUTE * 5) / 1000, numRequested: 2, }), buildAssetConditionEvaluationRecord({ id: 'e', - evaluationId: 20, + evaluationId: '20', timestamp: (now - ONE_MINUTE * 4) / 1000, numRequested: 0, }), buildAssetConditionEvaluationRecord({ id: 'd', - evaluationId: 13, + evaluationId: '13', timestamp: (now - ONE_MINUTE * 3) / 1000, numRequested: 2, }), buildAssetConditionEvaluationRecord({ id: 'c', timestamp: (now - ONE_MINUTE * 2) / 1000, - evaluationId: 12, + evaluationId: '12', numRequested: 0, }), buildAssetConditionEvaluationRecord({ id: 'b', - evaluationId: 4, + evaluationId: '4', timestamp: (now - ONE_MINUTE) / 1000, numRequested: 0, }), buildAssetConditionEvaluationRecord({ id: 'a', - evaluationId: 0, + evaluationId: '0', timestamp: now / 1000, numRequested: 2, }), @@ -132,13 +132,13 @@ export const buildEvaluationRecordsWithoutPartitions = () => { }), buildAssetConditionEvaluationRecord({ id: 'f', - evaluationId: 24, + evaluationId: '24', timestamp: (now - ONE_MINUTE * 5) / 1000, numRequested: 0, }), buildAssetConditionEvaluationRecord({ id: 'e', - evaluationId: 20, + evaluationId: '20', timestamp: (now - ONE_MINUTE * 4) / 1000, numRequested: 0, }), @@ -249,7 +249,7 @@ export const Evaluations = { autoMaterializePolicy: buildAutoMaterializePolicy({ rules: BASE_AUTOMATERIALIZE_RULES, }), - currentAutoMaterializeEvaluationId: 1000, + currentAutoMaterializeEvaluationId: '1000', }), assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(), }, diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/PartitionSegmentWithPopover.fixtures.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/PartitionSegmentWithPopover.fixtures.ts index bfa2ad7276b43..004ee5eebd9d3 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/PartitionSegmentWithPopover.fixtures.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__fixtures__/PartitionSegmentWithPopover.fixtures.ts @@ -6,7 +6,7 @@ import { } from '../types/PartitionSubsetListQuery.types'; export const SAMPLE_ASSET_KEY_PATH = ['foo', 'bar']; -export const SAMPLE_EVALUATION_ID = 1; +export const SAMPLE_EVALUATION_ID = '1'; export const SAMPLE_NODE_UNIQUE_ID = 'a1b2c3'; export const SAMPLE_PARTITION_KEYS = ['partition-a', 'partition-b']; export const SAMPLE_MANY_PARTITIONS_COUNT = 100000; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__stories__/PolicyEvaluationTable.stories.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__stories__/PolicyEvaluationTable.stories.tsx index d3ac4efa7c164..be05af260b087 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__stories__/PolicyEvaluationTable.stories.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__stories__/PolicyEvaluationTable.stories.tsx @@ -33,7 +33,7 @@ export const NonPartitioned = () => { {}} @@ -77,7 +77,7 @@ export const NewTableStyle = () => { {}} @@ -108,7 +108,7 @@ export const Partitioned = () => { {}} @@ -133,7 +133,7 @@ export const SpecificPartition = () => { {}} diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__tests__/PolicyEvaluationTable.test.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__tests__/PolicyEvaluationTable.test.tsx index 9d292035ed5ca..b14ba318e1ab1 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__tests__/PolicyEvaluationTable.test.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/__tests__/PolicyEvaluationTable.test.tsx @@ -23,7 +23,7 @@ describe('PolicyEvaluationTable', () => { {}} @@ -53,7 +53,7 @@ describe('PolicyEvaluationTable', () => { {}} @@ -83,7 +83,7 @@ describe('PolicyEvaluationTable', () => { {}} @@ -124,7 +124,7 @@ describe('PolicyEvaluationTable', () => { {}} @@ -170,7 +170,7 @@ describe('PolicyEvaluationTable', () => { {}} diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx index 02e1bfb9b02f9..133153b2bdc29 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx @@ -3,7 +3,7 @@ import {AssetKey} from '../types'; export type NoConditionsMetEvaluation = { __typename: 'no_conditions_met'; - evaluationId: number; + evaluationId: string; amount: number; endTimestamp: number | 'now'; startTimestamp: number; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/GetEvaluationsQuery.types.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/GetEvaluationsQuery.types.ts index c4dc5f1da84f4..e7e65675605bc 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/GetEvaluationsQuery.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/GetEvaluationsQuery.types.ts @@ -337,7 +337,7 @@ export type NewEvaluationNodeFragment = { export type AssetConditionEvaluationRecordFragment = { __typename: 'AssetConditionEvaluationRecord'; id: string; - evaluationId: any; + evaluationId: string; numRequested: number; runIds: Array; timestamp: number; @@ -750,7 +750,7 @@ export type GetEvaluationsQuery = { records: Array<{ __typename: 'AssetConditionEvaluationRecord'; id: string; - evaluationId: any; + evaluationId: string; numRequested: number; runIds: Array; timestamp: number; @@ -1152,7 +1152,7 @@ export type GetEvaluationsQuery = { export type GetEvaluationsSpecificPartitionQueryVariables = Types.Exact<{ assetKey: Types.AssetKeyInput; - evaluationId: Types.Scalars['BigInt']['input']; + evaluationId: Types.Scalars['ID']['input']; partition: Types.Scalars['String']['input']; }>; @@ -1524,4 +1524,4 @@ export type GetEvaluationsSpecificPartitionQuery = { export const GetEvaluationsQueryVersion = 'fb2fadc8e0c982926deb90a3889f2b705bb340a98ade6a7e28175cfa10e5a1b8'; -export const GetEvaluationsSpecificPartitionQueryVersion = 'd753be21aeea04a8cb0fa20e6933463ca16c19413df0741bd94b5a06dd8d1de7'; +export const GetEvaluationsSpecificPartitionQueryVersion = 'fa9ed1faccad8a56180a76f841073f554b98c1a8f46b6d9bf1ae6f9d7d632398'; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/PartitionSubsetListQuery.types.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/PartitionSubsetListQuery.types.ts index ac13ad434476b..cd6d1a4036503 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/PartitionSubsetListQuery.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types/PartitionSubsetListQuery.types.ts @@ -4,7 +4,7 @@ import * as Types from '../../../graphql/types'; export type PartitionSubsetListQueryVariables = Types.Exact<{ assetKey: Types.AssetKeyInput; - evaluationId: Types.Scalars['BigInt']['input']; + evaluationId: Types.Scalars['ID']['input']; nodeUniqueId: Types.Scalars['String']['input']; }>; @@ -13,4 +13,4 @@ export type PartitionSubsetListQuery = { truePartitionsForAutomationConditionEvaluationNode: Array; }; -export const PartitionSubsetListQueryVersion = '2c8c8f7bd10e0be6ef37e833057c78ca202b23f0bc89dafe4e8a12389e3fe2b8'; +export const PartitionSubsetListQueryVersion = '9a560790b6c1828137f31532f5879cfb6611d9ca8c14b7f315464510b6a4bd75'; 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 781328f313acb..c99e35f78995a 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 @@ -13,9 +13,7 @@ export function useEvaluationsQueryResult({assetKey}: {assetKey: AssetKey}) { data.assetConditionEvaluationRecordsOrError?.__typename === 'AssetConditionEvaluationRecords' ) { - return data.assetConditionEvaluationRecordsOrError.records[ - PAGE_SIZE - 1 - ]?.evaluationId.toString(); + return data.assetConditionEvaluationRecordsOrError.records[PAGE_SIZE - 1]?.evaluationId; } return undefined; }, diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/auto-materialization/types/AssetDaemonTicksQuery.types.ts b/js_modules/dagster-ui/packages/ui-core/src/assets/auto-materialization/types/AssetDaemonTicksQuery.types.ts index bd890ec5f686e..cfc42ce916c3e 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/auto-materialization/types/AssetDaemonTicksQuery.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/auto-materialization/types/AssetDaemonTicksQuery.types.ts @@ -10,7 +10,7 @@ export type AssetDaemonTickFragment = { status: Types.InstigationTickStatus; instigationType: Types.InstigationType; requestedAssetMaterializationCount: number; - autoMaterializeAssetEvaluationId: any | null; + autoMaterializeAssetEvaluationId: string | null; error: { __typename: 'PythonError'; message: string; @@ -49,7 +49,7 @@ export type AssetDaemonTicksQuery = { status: Types.InstigationTickStatus; instigationType: Types.InstigationType; requestedAssetMaterializationCount: number; - autoMaterializeAssetEvaluationId: any | null; + autoMaterializeAssetEvaluationId: string | null; error: { __typename: 'PythonError'; message: string; 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 f2c550a0bc0c3..9d542e4a2057f 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 @@ -681,7 +681,7 @@ type AssetNode { hasReportRunlessAssetEventPermission: Boolean! hasAssetChecks: Boolean! assetChecksOrError(limit: Int, pipeline: PipelineSelector): AssetChecksOrError! - currentAutoMaterializeEvaluationId: BigInt + currentAutoMaterializeEvaluationId: ID targetingInstigators: [Instigator!]! } @@ -958,8 +958,6 @@ type AssetCheckNeedsAgentUpgradeError implements Error { message: String! } -scalar BigInt - union Instigator = Schedule | Sensor enum EvaluationErrorReason { @@ -2579,6 +2577,8 @@ enum InstigationType { AUTO_MATERIALIZE } +scalar BigInt + type InstigationStateNotFoundError implements Error { message: String! name: String! @@ -2611,7 +2611,7 @@ type InstigationTick { requestedAssetKeys: [AssetKey!]! requestedAssetMaterializationCount: Int! requestedMaterializationsForAssets: [RequestedMaterializationsForAsset!]! - autoMaterializeAssetEvaluationId: BigInt + autoMaterializeAssetEvaluationId: ID instigationType: InstigationType! } @@ -3351,15 +3351,15 @@ type Query { ): AutoMaterializeAssetEvaluationRecordsOrError truePartitionsForAutomationConditionEvaluationNode( assetKey: AssetKeyInput! - evaluationId: BigInt! + evaluationId: ID! nodeUniqueId: String ): [String!]! autoMaterializeEvaluationsForEvaluationId( - evaluationId: BigInt! + evaluationId: ID! ): AutoMaterializeAssetEvaluationRecordsOrError assetConditionEvaluationForPartition( assetKey: AssetKeyInput! - evaluationId: BigInt! + evaluationId: ID! partition: String! ): AssetConditionEvaluation assetConditionEvaluationRecordsOrError( @@ -3368,7 +3368,7 @@ type Query { cursor: String ): AssetConditionEvaluationRecordsOrError assetConditionEvaluationsForEvaluationId( - evaluationId: BigInt! + evaluationId: ID! ): AssetConditionEvaluationRecordsOrError autoMaterializeTicks( dayRange: Int @@ -3558,7 +3558,7 @@ type AutoMaterializeAssetEvaluationRecords { type AutoMaterializeAssetEvaluationRecord { id: ID! - evaluationId: BigInt! + evaluationId: ID! numRequested: Int! numSkipped: Int! numDiscarded: Int! @@ -3661,7 +3661,7 @@ type AssetConditionEvaluationRecords { type AssetConditionEvaluationRecord { id: ID! - evaluationId: BigInt! + evaluationId: ID! runIds: [String!]! timestamp: Float! assetKey: AssetKey! 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 c4de18683c45f..d302476462252 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 @@ -303,7 +303,7 @@ export type AssetConditionEvaluationRecord = { assetKey: AssetKey; endTimestamp: Maybe; evaluation: AssetConditionEvaluation; - evaluationId: Scalars['BigInt']['output']; + evaluationId: Scalars['ID']['output']; evaluationNodes: Array; id: Scalars['ID']['output']; isLegacy: Scalars['Boolean']['output']; @@ -427,7 +427,7 @@ export type AssetNode = { changedReasons: Array; computeKind: Maybe; configField: Maybe; - currentAutoMaterializeEvaluationId: Maybe; + currentAutoMaterializeEvaluationId: Maybe; dataVersion: Maybe; dataVersionByPartition: Array>; dependedBy: Array; @@ -624,7 +624,7 @@ export type AutoMaterializeAssetEvaluationNeedsMigrationError = Error & { export type AutoMaterializeAssetEvaluationRecord = { __typename: 'AutoMaterializeAssetEvaluationRecord'; assetKey: AssetKey; - evaluationId: Scalars['BigInt']['output']; + evaluationId: Scalars['ID']['output']; id: Scalars['ID']['output']; numDiscarded: Scalars['Int']['output']; numRequested: Scalars['Int']['output']; @@ -1987,7 +1987,7 @@ export enum InstigationStatus { export type InstigationTick = { __typename: 'InstigationTick'; - autoMaterializeAssetEvaluationId: Maybe; + autoMaterializeAssetEvaluationId: Maybe; cursor: Maybe; dynamicPartitionsRequestResults: Array; endTimestamp: Maybe; @@ -3797,7 +3797,7 @@ export type QueryAssetCheckExecutionsArgs = { export type QueryAssetConditionEvaluationForPartitionArgs = { assetKey: AssetKeyInput; - evaluationId: Scalars['BigInt']['input']; + evaluationId: Scalars['ID']['input']; partition: Scalars['String']['input']; }; @@ -3808,7 +3808,7 @@ export type QueryAssetConditionEvaluationRecordsOrErrorArgs = { }; export type QueryAssetConditionEvaluationsForEvaluationIdArgs = { - evaluationId: Scalars['BigInt']['input']; + evaluationId: Scalars['ID']['input']; }; export type QueryAssetNodeAdditionalRequiredKeysArgs = { @@ -3851,7 +3851,7 @@ export type QueryAutoMaterializeAssetEvaluationsOrErrorArgs = { }; export type QueryAutoMaterializeEvaluationsForEvaluationIdArgs = { - evaluationId: Scalars['BigInt']['input']; + evaluationId: Scalars['ID']['input']; }; export type QueryAutoMaterializeTicksArgs = { @@ -4020,7 +4020,7 @@ export type QueryTopLevelResourceDetailsOrErrorArgs = { export type QueryTruePartitionsForAutomationConditionEvaluationNodeArgs = { assetKey: AssetKeyInput; - evaluationId: Scalars['BigInt']['input']; + evaluationId: Scalars['ID']['input']; nodeUniqueId?: InputMaybe; }; @@ -6234,7 +6234,9 @@ export const buildAssetConditionEvaluationRecord = ( ? ({} as AssetConditionEvaluation) : buildAssetConditionEvaluation({}, relationshipsToOmit), evaluationId: - overrides && overrides.hasOwnProperty('evaluationId') ? overrides.evaluationId! : 'unde', + overrides && overrides.hasOwnProperty('evaluationId') + ? overrides.evaluationId! + : '9239f05d-b105-4691-86f3-1d5a918e58b2', evaluationNodes: overrides && overrides.hasOwnProperty('evaluationNodes') ? overrides.evaluationNodes! : [], id: @@ -6561,7 +6563,7 @@ export const buildAssetNode = ( currentAutoMaterializeEvaluationId: overrides && overrides.hasOwnProperty('currentAutoMaterializeEvaluationId') ? overrides.currentAutoMaterializeEvaluationId! - : 'libero', + : 'bcbeb9b8-1fb4-4466-a03e-1185d19566d1', dataVersion: overrides && overrides.hasOwnProperty('dataVersion') ? overrides.dataVersion! : 'a', dataVersionByPartition: @@ -6880,7 +6882,9 @@ export const buildAutoMaterializeAssetEvaluationRecord = ( ? ({} as AssetKey) : buildAssetKey({}, relationshipsToOmit), evaluationId: - overrides && overrides.hasOwnProperty('evaluationId') ? overrides.evaluationId! : 'molestiae', + overrides && overrides.hasOwnProperty('evaluationId') + ? overrides.evaluationId! + : 'f9a60fcd-3c3e-48fc-b5b9-05e77c55711f', id: overrides && overrides.hasOwnProperty('id') ? overrides.id! @@ -9059,7 +9063,7 @@ export const buildInstigationTick = ( autoMaterializeAssetEvaluationId: overrides && overrides.hasOwnProperty('autoMaterializeAssetEvaluationId') ? overrides.autoMaterializeAssetEvaluationId! - : 'sed', + : '95e99e1c-3377-4875-abc8-9f50fc5b7778', cursor: overrides && overrides.hasOwnProperty('cursor') ? overrides.cursor! : 'voluptatem', dynamicPartitionsRequestResults: overrides && overrides.hasOwnProperty('dynamicPartitionsRequestResults') 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 b717436ebb363..ce9827b8b90c0 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 @@ -149,7 +149,7 @@ const AssetDetailRow = ({ $height: number; assetKey: AssetKeyInput; partitionKeys?: string[]; - evaluationId: number; + evaluationId: string; }) => { const numMaterializations = partitionKeys?.length || 1; const queryResult = useQuery( diff --git a/js_modules/dagster-ui/packages/ui-core/src/instigation/types/TickDetailsDialog.types.ts b/js_modules/dagster-ui/packages/ui-core/src/instigation/types/TickDetailsDialog.types.ts index fb895af5b9e9b..30bbb75f6401f 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/instigation/types/TickDetailsDialog.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/instigation/types/TickDetailsDialog.types.ts @@ -17,7 +17,7 @@ export type SelectedTickQuery = { __typename: 'InstigationTick'; id: string; requestedAssetMaterializationCount: number; - autoMaterializeAssetEvaluationId: any | null; + autoMaterializeAssetEvaluationId: string | null; tickId: string; status: Types.InstigationTickStatus; timestamp: number; diff --git a/js_modules/dagster-ui/packages/ui-core/src/sensors/types/AssetSensorTicksQuery.types.ts b/js_modules/dagster-ui/packages/ui-core/src/sensors/types/AssetSensorTicksQuery.types.ts index 6ad0f04091d79..f565be6165168 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/sensors/types/AssetSensorTicksQuery.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/sensors/types/AssetSensorTicksQuery.types.ts @@ -40,7 +40,7 @@ export type AssetSensorTicksQuery = { status: Types.InstigationTickStatus; instigationType: Types.InstigationType; requestedAssetMaterializationCount: number; - autoMaterializeAssetEvaluationId: any | null; + autoMaterializeAssetEvaluationId: string | null; error: { __typename: 'PythonError'; message: string; 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 78393febac6e8..b12396e5c124b 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 @@ -248,7 +248,7 @@ def __init__(self, evaluation: AutomationConditionEvaluation): class GrapheneAssetConditionEvaluationRecord(graphene.ObjectType): id = graphene.NonNull(graphene.ID) - evaluationId = graphene.NonNull(graphene.BigInt) + evaluationId = graphene.NonNull(graphene.ID) runIds = non_null_list(graphene.String) timestamp = graphene.NonNull(graphene.Float) 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 52ebc8362a205..a18b98f0954c6 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py @@ -308,7 +308,7 @@ class GrapheneAssetNode(graphene.ObjectType): limit=graphene.Argument(graphene.Int), pipeline=graphene.Argument(GraphenePipelineSelector), ) - currentAutoMaterializeEvaluationId = graphene.BigInt() + currentAutoMaterializeEvaluationId = graphene.ID() targetingInstigators = non_null_list(GrapheneInstigator) class Meta: 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 290e79ec1b534..d1e9c4d7f0025 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 @@ -210,7 +210,7 @@ def create_graphene_auto_materialize_rules_with_rule_evaluations( class GrapheneAutoMaterializeAssetEvaluationRecord(graphene.ObjectType): id = graphene.NonNull(graphene.ID) - evaluationId = graphene.NonNull(graphene.BigInt) + evaluationId = graphene.NonNull(graphene.ID) numRequested = graphene.NonNull(graphene.Int) numSkipped = graphene.NonNull(graphene.Int) numDiscarded = graphene.NonNull(graphene.Int) diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py b/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py index 7365b853caca1..a1e33ed4df30a 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/instigation.py @@ -250,7 +250,7 @@ class GrapheneInstigationTick(graphene.ObjectType): requestedAssetKeys = non_null_list(GrapheneAssetKey) requestedAssetMaterializationCount = graphene.NonNull(graphene.Int) requestedMaterializationsForAssets = non_null_list(GrapheneRequestedMaterializationsForAsset) - autoMaterializeAssetEvaluationId = graphene.Field(graphene.BigInt) + autoMaterializeAssetEvaluationId = graphene.Field(graphene.ID) instigationType = graphene.NonNull(GrapheneInstigationType) class Meta: 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 eca566a7a2049..c54ab973962d4 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py @@ -566,14 +566,14 @@ class Meta: truePartitionsForAutomationConditionEvaluationNode = graphene.Field( non_null_list(graphene.String), assetKey=graphene.Argument(graphene.NonNull(GrapheneAssetKeyInput)), - evaluationId=graphene.Argument(graphene.NonNull(graphene.BigInt)), + 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.", ) autoMaterializeEvaluationsForEvaluationId = graphene.Field( GrapheneAutoMaterializeAssetEvaluationRecordsOrError, - evaluationId=graphene.Argument(graphene.NonNull(graphene.BigInt)), + evaluationId=graphene.Argument(graphene.NonNull(graphene.ID)), description=( "Retrieve the auto materialization evaluation records for a given evaluation ID." ), @@ -582,7 +582,7 @@ class Meta: assetConditionEvaluationForPartition = graphene.Field( GrapheneAssetConditionEvaluation, assetKey=graphene.Argument(graphene.NonNull(GrapheneAssetKeyInput)), - evaluationId=graphene.Argument(graphene.NonNull(graphene.BigInt)), + evaluationId=graphene.Argument(graphene.NonNull(graphene.ID)), partition=graphene.Argument(graphene.NonNull(graphene.String)), description="Retrieve the condition evaluation for an asset and partition.", ) @@ -597,7 +597,7 @@ class Meta: assetConditionEvaluationsForEvaluationId = graphene.Field( GrapheneAssetConditionEvaluationRecordsOrError, - evaluationId=graphene.Argument(graphene.NonNull(graphene.BigInt)), + evaluationId=graphene.Argument(graphene.NonNull(graphene.ID)), description=("Retrieve the condition evaluation records for a given evaluation ID."), ) @@ -1230,13 +1230,13 @@ def resolve_assetConditionEvaluationForPartition( self, graphene_info: ResolveInfo, assetKey: GrapheneAssetKeyInput, - evaluationId: int, + evaluationId: str, partition: str, ): return fetch_asset_condition_evaluation_record_for_partition( graphene_info=graphene_info, graphene_asset_key=assetKey, - evaluation_id=evaluationId, + evaluation_id=int(evaluationId), partition_key=partition, ) @@ -1255,13 +1255,13 @@ def resolve_truePartitionsForAutomationConditionEvaluationNode( self, graphene_info: ResolveInfo, assetKey: GrapheneAssetKeyInput, - evaluationId: int, + evaluationId: str, nodeUniqueId: str, ): return fetch_true_partitions_for_evaluation_node( graphene_info=graphene_info, graphene_asset_key=assetKey, - evaluation_id=evaluationId, + evaluation_id=int(evaluationId), node_unique_id=nodeUniqueId, ) diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_condition_evaluations.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_condition_evaluations.py index dc82a7672487e..b9bc41935f671 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_condition_evaluations.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_condition_evaluations.py @@ -133,7 +133,7 @@ def test_get_tick_range(self, graphql_context): assert len(result.data["autoMaterializeTicks"]) == 1 tick = result.data["autoMaterializeTicks"][0] assert tick["endTimestamp"] == end_timestamp - assert tick["autoMaterializeAssetEvaluationId"] == 3 + assert tick["autoMaterializeAssetEvaluationId"] == "3" assert sorted(tick["requestedAssetKeys"], key=lambda x: x["path"][0]) == [ {"path": ["bar"]}, {"path": ["baz"]}, @@ -164,8 +164,8 @@ def test_get_tick_range(self, graphql_context): ) assert len(result.data["autoMaterializeTicks"]) == 1 tick = result.data["autoMaterializeTicks"][0] - assert ( - tick["autoMaterializeAssetEvaluationId"] == success_2.automation_condition_evaluation_id + assert tick["autoMaterializeAssetEvaluationId"] == str( + success_2.automation_condition_evaluation_id ) result = execute_dagster_graphql( @@ -183,9 +183,8 @@ def test_get_tick_range(self, graphql_context): ticks = result.data["autoMaterializeTicks"] assert len(ticks) == 1 assert ticks[0]["timestamp"] == success_1.timestamp - assert ( - ticks[0]["autoMaterializeAssetEvaluationId"] - == success_1.automation_condition_evaluation_id + assert ticks[0]["autoMaterializeAssetEvaluationId"] == str( + success_1.automation_condition_evaluation_id ) cursor = ticks[0]["id"] @@ -285,7 +284,7 @@ def test_get_tick_range(self, graphql_context): LEGACY_QUERY_FOR_SPECIFIC_PARTITION = ( FRAGMENTS + """ -query GetPartitionEvaluationQuery($assetKey: AssetKeyInput!, $partition: String!, $evaluationId: BigInt!) { +query GetPartitionEvaluationQuery($assetKey: AssetKeyInput!, $partition: String!, $evaluationId: ID!) { assetConditionEvaluationForPartition(assetKey: $assetKey, partition: $partition, evaluationId: $evaluationId) { ...evaluationFields } @@ -296,7 +295,7 @@ def test_get_tick_range(self, graphql_context): LEGACY_QUERY_FOR_EVALUATION_ID = ( FRAGMENTS + """ -query GetEvaluationsForEvaluationIdQuery($evaluationId: BigInt!) { +query GetEvaluationsForEvaluationIdQuery($evaluationId: ID!) { assetConditionEvaluationsForEvaluationId(evaluationId: $evaluationId) { ... on AssetConditionEvaluationRecords { records { @@ -343,7 +342,7 @@ def test_get_tick_range(self, graphql_context): """ TRUE_PARTITIONS_QUERY = """ -query GetTruePartitions($assetKey: AssetKeyInput!, $evaluationId: BigInt!, $nodeUniqueId: String!) { +query GetTruePartitions($assetKey: AssetKeyInput!, $evaluationId: ID!, $nodeUniqueId: String!) { truePartitionsForAutomationConditionEvaluationNode(assetKey: $assetKey, evaluationId: $evaluationId, nodeUniqueId: $nodeUniqueId) } """ @@ -386,7 +385,7 @@ def test_auto_materialize_sensor(self, graphql_context: WorkspaceRequestContext) "assetKey": {"path": ["fresh_diamond_bottom"]}, }, ) - assert not results.data["assetNodeOrError"]["currentAutoMaterializeEvaluationId"] + assert results.data["assetNodeOrError"]["currentAutoMaterializeEvaluationId"] == "0" with patch( graphql_context.instance.__class__.__module__ @@ -408,7 +407,7 @@ def test_auto_materialize_sensor(self, graphql_context: WorkspaceRequestContext) instigator["name"] == "my_auto_materialize_sensor" for instigator in results.data["assetNodeOrError"]["targetingInstigators"] ) - assert results.data["assetNodeOrError"]["currentAutoMaterializeEvaluationId"] == 12345 + assert results.data["assetNodeOrError"]["currentAutoMaterializeEvaluationId"] == "12345" def _get_node( self, unique_id: str, evaluations: Sequence[Mapping[str, Any]]