Skip to content

Commit

Permalink
Make the tickId field on GrapheneInstigationTick an ID instead of a B…
Browse files Browse the repository at this point in the history
…igInt (#25731)

Summary:
Fix precision issues with this field when it was greater than 32 bits.

BK, load tick logs in the dagster UI locally

- Fixed an issue where loading the logs for a sensor tick in the Dagster
UI would sometimes fail if the ID of the tick was larger than 32 bits.

## Summary & Motivation

## How I Tested These Changes

## Changelog

> Insert changelog entry or delete this section.
  • Loading branch information
gibsondan authored Nov 8, 2024
1 parent ad87c12 commit 01f5097
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 24 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.

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

3 changes: 1 addition & 2 deletions js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts

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 @@ -82,7 +82,7 @@ const TickDetailsDialogImpl = ({tickId, tickResultType, instigationSelector}: In
const [activeTab, setActiveTab] = useState<'result' | 'logs'>('result');

const {data} = useQuery<SelectedTickQuery, SelectedTickQueryVariables>(JOB_SELECTED_TICK_QUERY, {
variables: {instigationSelector, tickId: tickId || 0},
variables: {instigationSelector, tickId: tickId || ''},
skip: !tickId,
});

Expand Down Expand Up @@ -284,7 +284,7 @@ function PartitionsTable({partitions}: {partitions: DynamicPartitionsRequestResu
}

const JOB_SELECTED_TICK_QUERY = gql`
query SelectedTickQuery($instigationSelector: InstigationSelector!, $tickId: BigInt!) {
query SelectedTickQuery($instigationSelector: InstigationSelector!, $tickId: ID!) {
instigationStateOrError(instigationSelector: $instigationSelector) {
... on InstigationState {
id
Expand Down

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 @@ -27,7 +27,7 @@ export const TickLogDialog = ({
onClose: () => void;
}) => {
const {data} = useQuery<TickLogEventsQuery, TickLogEventsQueryVariables>(TICK_LOG_EVENTS_QUERY, {
variables: {instigationSelector, tickId: Number(tick.tickId)},
variables: {instigationSelector, tickId: tick.tickId},
notifyOnNetworkStatusChange: true,
});

Expand Down Expand Up @@ -74,7 +74,7 @@ export const QueryfulTickLogsTable = ({instigationSelector, tick}: TickLogTableP
const {data, loading} = useQuery<TickLogEventsQuery, TickLogEventsQueryVariables>(
TICK_LOG_EVENTS_QUERY,
{
variables: {instigationSelector, tickId: Number(tick.tickId)},
variables: {instigationSelector, tickId: tick.tickId},
},
);

Expand Down Expand Up @@ -153,7 +153,7 @@ export const QueryfulTickLogsTable = ({instigationSelector, tick}: TickLogTableP
};

const TICK_LOG_EVENTS_QUERY = gql`
query TickLogEventsQuery($instigationSelector: InstigationSelector!, $tickId: BigInt!) {
query TickLogEventsQuery($instigationSelector: InstigationSelector!, $tickId: ID!) {
instigationStateOrError(instigationSelector: $instigationSelector) {
... on InstigationState {
id
Expand Down

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 @@ -541,7 +541,7 @@ class GrapheneInstigationState(graphene.ObjectType):
runsCount = graphene.NonNull(graphene.Int)
tick = graphene.Field(
graphene.NonNull(GrapheneInstigationTick),
tickId=graphene.NonNull(graphene.BigInt),
tickId=graphene.NonNull(graphene.ID),
)
ticks = graphene.Field(
non_null_list(GrapheneInstigationTick),
Expand Down Expand Up @@ -673,10 +673,10 @@ def resolve_runsCount(self, graphene_info: ResolveInfo):
def resolve_tick(
self,
graphene_info: ResolveInfo,
tickId: int,
tickId: str,
) -> GrapheneInstigationTick:
schedule_storage = check.not_none(graphene_info.context.instance.schedule_storage)
tick = schedule_storage.get_tick(tickId)
tick = schedule_storage.get_tick(int(tickId))

return GrapheneInstigationTick(tick)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@


GET_TICKS_QUERY = """
query TicksQuery($sensorSelector: SensorSelector!, $statuses: [InstigationTickStatus!], $tickId: BigInt!) {
query TicksQuery($sensorSelector: SensorSelector!, $statuses: [InstigationTickStatus!], $tickId: ID!) {
sensorOrError(sensorSelector: $sensorSelector) {
__typename
... on PythonError {
Expand Down Expand Up @@ -1449,7 +1449,7 @@ def test_sensor_ticks_filtered(graphql_context: WorkspaceRequestContext):
result = execute_dagster_graphql(
graphql_context,
GET_TICKS_QUERY,
variables={"sensorSelector": sensor_selector, "tickId": started_tick_id},
variables={"sensorSelector": sensor_selector, "tickId": str(started_tick_id)},
)
assert len(result.data["sensorOrError"]["sensorState"]["ticks"]) == 4

Expand All @@ -1459,7 +1459,7 @@ def test_sensor_ticks_filtered(graphql_context: WorkspaceRequestContext):
variables={
"sensorSelector": sensor_selector,
"statuses": ["STARTED"],
"tickId": started_tick_id,
"tickId": str(started_tick_id),
},
)
assert len(result.data["sensorOrError"]["sensorState"]["ticks"]) == 1
Expand All @@ -1476,7 +1476,7 @@ def test_sensor_ticks_filtered(graphql_context: WorkspaceRequestContext):
variables={
"sensorSelector": sensor_selector,
"statuses": ["FAILURE"],
"tickId": failed_tick_id,
"tickId": str(failed_tick_id),
},
)
assert len(result.data["sensorOrError"]["sensorState"]["ticks"]) == 1
Expand All @@ -1493,7 +1493,7 @@ def test_sensor_ticks_filtered(graphql_context: WorkspaceRequestContext):
variables={
"sensorSelector": sensor_selector,
"statuses": ["SKIPPED"],
"tickId": skipped_tick_id,
"tickId": str(skipped_tick_id),
},
)
assert len(result.data["sensorOrError"]["sensorState"]["ticks"]) == 1
Expand Down

1 comment on commit 01f5097

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-aqedph46x-elementl.vercel.app

Built with commit 01f5097.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.