Skip to content

Commit

Permalink
[ui]: Run cancelled events include an error that should be displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Aug 6, 2024
1 parent c137304 commit 165363b
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 5 deletions.

Large diffs are not rendered by default.

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

10 changes: 9 additions & 1 deletion 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 @@ -184,6 +184,7 @@ export const LogsRowStructuredContent = ({node, metadata}: IStructuredContentPro
case 'AlertFailureEvent':
return <DefaultContent eventType={eventType} message={node.message} eventIntent="warning" />;
case 'ResourceInitFailureEvent':
case 'RunCanceledEvent':
case 'RunFailureEvent':
if (node.error) {
return <FailureContent message={node.message} error={node.error} eventType={eventType} />;
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.

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 @@ -341,7 +341,12 @@ def from_dagster_event_record(event_record: EventLogEntry, pipeline_name: str) -
DagsterEventType.RUN_CANCELED,
DagsterEventType.PIPELINE_CANCELED,
):
return GrapheneRunCanceledEvent(pipelineName=pipeline_name, **basic_params)
data = dagster_event.job_canceled_data
return GrapheneRunCanceledEvent(
pipelineName=pipeline_name,
error=GraphenePythonError(data.error) if (data and data.error) else None,
**basic_params
)
elif dagster_event.event_type in (
DagsterEventType.RUN_START,
DagsterEventType.PIPELINE_START,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Meta:

class GrapheneRunCanceledEvent(graphene.ObjectType):
class Meta:
interfaces = (GrapheneMessageEvent, GrapheneRunEvent)
interfaces = (GrapheneMessageEvent, GrapheneRunEvent, GrapheneErrorEvent)
name = "RunCanceledEvent"


Expand Down
5 changes: 5 additions & 0 deletions python_modules/dagster/dagster/_core/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,11 @@ def job_failure_data(self) -> "JobFailureData":
_assert_type("job_failure_data", DagsterEventType.RUN_FAILURE, self.event_type)
return cast(JobFailureData, self.event_specific_data)

@property
def job_canceled_data(self) -> "JobCanceledData":
_assert_type("job_canceled_data", DagsterEventType.RUN_CANCELED, self.event_type)
return cast(JobCanceledData, self.event_specific_data)

@property
def engine_event_data(self) -> "EngineEventData":
_assert_type(
Expand Down

0 comments on commit 165363b

Please sign in to comment.