Skip to content

Commit

Permalink
Add ASSET_MATERIALIZATION_FAILURE event
Browse files Browse the repository at this point in the history
test fixes
  • Loading branch information
gibsondan committed Aug 9, 2024
1 parent e6a803c commit 677b697
Show file tree
Hide file tree
Showing 18 changed files with 273 additions and 4 deletions.

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

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql

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

46 changes: 46 additions & 0 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 @@ -152,6 +152,7 @@ export const LogsRowStructuredContent = ({node, metadata}: IStructuredContentPro
/>
);
case 'AssetMaterializationPlannedEvent':
case 'AssetMaterializationFailureEvent':
return <DefaultContent eventType={eventType} message={node.message} />;
case 'ObjectStoreOperationEvent':
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {weakmapMemoize} from '../app/Util';

export function filterLogs(logs: LogsProviderLogs, filter: LogFilter, filterStepKeys: string[]) {
const filteredNodes = logs.allNodes.filter((node) => {
// These events are used to determine which assets a run will materialize and are not intended
// These events are used for internal bookkeeping and are not intended
// to be displayed in the Dagster UI. Pagination is offset based, so we remove these logs client-side.
if (
node.__typename === 'AssetMaterializationPlannedEvent' ||
node.__typename === 'AssetCheckEvaluationPlannedEvent'
node.__typename === 'AssetCheckEvaluationPlannedEvent' ||
node.__typename === 'AssetMaterializationFailureEvent'
) {
return false;
}
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.

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 @@ -222,6 +222,7 @@ def from_dagster_event_record(event_record: EventLogEntry, pipeline_name: str) -
GrapheneAlertSuccessEvent,
GrapheneAssetCheckEvaluationEvent,
GrapheneAssetCheckEvaluationPlannedEvent,
GrapheneAssetMaterializationFailureEvent,
GrapheneAssetMaterializationPlannedEvent,
GrapheneEngineEvent,
GrapheneExecutionStepFailureEvent,
Expand Down Expand Up @@ -303,6 +304,8 @@ def from_dagster_event_record(event_record: EventLogEntry, pipeline_name: str) -
)
elif dagster_event.event_type == DagsterEventType.ASSET_MATERIALIZATION_PLANNED:
return GrapheneAssetMaterializationPlannedEvent(event=event_record)
elif dagster_event.event_type == DagsterEventType.ASSET_MATERIALIZATION_FAILURE:
return GrapheneAssetMaterializationFailureEvent(event=event_record)
elif dagster_event.event_type == DagsterEventType.STEP_EXPECTATION_RESULT:
data = cast(StepExpectationResultData, dagster_event.event_specific_data)
return GrapheneStepExpectationResultEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,20 @@ def __init__(self, event):
)


class GrapheneAssetMaterializationFailureEvent(graphene.ObjectType):
assetKey = graphene.Field(GrapheneAssetKey)

class Meta:
name = "AssetMaterializationFailureEvent"
interfaces = (GrapheneMessageEvent, GrapheneRunEvent)

def __init__(self, event: EventLogEntry):
self._event = event

def resolve_assetKey(self, _graphene_info: ResolveInfo):
return self._event.get_dagster_event().asset_materialization_failure_data.asset_key


class GrapheneAssetMaterializationPlannedEvent(graphene.ObjectType):
assetKey = graphene.Field(GrapheneAssetKey)
runOrError = graphene.NonNull("dagster_graphql.schema.pipelines.pipeline.GrapheneRunOrError")
Expand Down Expand Up @@ -586,6 +600,7 @@ class Meta:
GrapheneAlertSuccessEvent,
GrapheneAlertFailureEvent,
GrapheneAssetMaterializationPlannedEvent,
GrapheneAssetMaterializationFailureEvent,
GrapheneAssetCheckEvaluationPlannedEvent,
GrapheneAssetCheckEvaluationEvent,
)
Expand Down
1 change: 1 addition & 0 deletions python_modules/dagster/dagster/_core/event_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class RunShardedEventsCursor(NamedTuple):
DagsterEventType.ASSET_MATERIALIZATION,
DagsterEventType.ASSET_OBSERVATION,
DagsterEventType.ASSET_MATERIALIZATION_PLANNED,
DagsterEventType.ASSET_MATERIALIZATION_FAILURE,
]

EventCursor: TypeAlias = Union[int, RunShardedEventsCursor]
Expand Down
Loading

0 comments on commit 677b697

Please sign in to comment.