Skip to content

Commit

Permalink
BigInt => ID in asset evaluations (#25673)
Browse files Browse the repository at this point in the history
## Summary & Motivation

## How I Tested These Changes

## Changelog

> Insert changelog entry or delete this section.
  • Loading branch information
gibsondan committed Oct 31, 2024
1 parent 82b2d59 commit abb0188
Show file tree
Hide file tree
Showing 28 changed files with 94 additions and 94 deletions.
4 changes: 2 additions & 2 deletions js_modules/dagster-ui/packages/ui-core/client.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
description: string;
numTrue: number;
assetKeyPath: string[];
evaluationId: number;
evaluationId: string;
nodeUniqueId: string;
selectPartition?: (partitionKey: string | null) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
description: string;
status?: AssetConditionEvaluationStatus;
assetKeyPath: string[];
evaluationId: number;
evaluationId: string;
nodeUniqueId: string;
selectPartition?: (partitionKey: string | null) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -111,7 +111,7 @@ const NewPolicyEvaluationTable = ({
toggleExpanded,
}: {
assetKeyPath: string[] | null;
evaluationId: number;
evaluationId: string;
expandedRecords: Set<string>;
toggleExpanded: (id: string) => void;
flattenedRecords: FlattenedConditionEvaluation<NewEvaluationNodeFragment>[];
Expand Down Expand Up @@ -343,7 +343,7 @@ export const PartitionedPolicyEvaluationTable = ({
selectPartition,
}: {
assetKeyPath: string[] | null;
evaluationId: number;
evaluationId: string;
rootUniqueId: string;
flattenedRecords: FlattenedConditionEvaluation<PartitionedAssetConditionEvaluationNodeFragment>[];
expandedRecords: Set<string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
}),
Expand All @@ -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,
}),
Expand Down Expand Up @@ -249,7 +249,7 @@ export const Evaluations = {
autoMaterializePolicy: buildAutoMaterializePolicy({
rules: BASE_AUTOMATERIALIZE_RULES,
}),
currentAutoMaterializeEvaluationId: 1000,
currentAutoMaterializeEvaluationId: '1000',
}),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const NonPartitioned = () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation
selectPartition={() => {}}
Expand Down Expand Up @@ -77,7 +77,7 @@ export const NewTableStyle = () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation={false}
selectPartition={() => {}}
Expand Down Expand Up @@ -108,7 +108,7 @@ export const Partitioned = () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation
selectPartition={() => {}}
Expand All @@ -133,7 +133,7 @@ export const SpecificPartition = () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation
selectPartition={() => {}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('PolicyEvaluationTable', () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation
selectPartition={() => {}}
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('PolicyEvaluationTable', () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation
selectPartition={() => {}}
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('PolicyEvaluationTable', () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation={false}
selectPartition={() => {}}
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('PolicyEvaluationTable', () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation
selectPartition={() => {}}
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('PolicyEvaluationTable', () => {
<PolicyEvaluationTable
evaluationNodes={nodes}
assetKeyPath={['foo', 'bar']}
evaluationId={1}
evaluationId="1"
rootUniqueId="a"
isLegacyEvaluation={false}
selectPartition={() => {}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit abb0188

Please sign in to comment.