Skip to content

Commit

Permalink
Filter custom events from stats_for_run query (#6781)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannkm committed Feb 24, 2022
1 parent 5cec1c8 commit 0ed9ad7
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ def get_stats_for_run(self, run_id):
db.func.max(SqlEventLogStorageTable.c.timestamp).label("last_event_timestamp"),
]
)
.where(SqlEventLogStorageTable.c.run_id == run_id)
.where(
db.and_(
SqlEventLogStorageTable.c.run_id == run_id,
SqlEventLogStorageTable.c.dagster_event_type != None,
)
)
.group_by("dagster_event_type")
)

Expand All @@ -301,9 +306,9 @@ def get_stats_for_run(self, run_id):
times = {}
for result in results:
(dagster_event_type, n_events_of_type, last_event_timestamp) = result
if dagster_event_type:
counts[dagster_event_type] = n_events_of_type
times[dagster_event_type] = last_event_timestamp
check.invariant(dagster_event_type is not None)
counts[dagster_event_type] = n_events_of_type
times[dagster_event_type] = last_event_timestamp

enqueued_time = times.get(DagsterEventType.PIPELINE_ENQUEUED.value, None)
launch_time = times.get(DagsterEventType.PIPELINE_STARTING.value, None)
Expand Down

0 comments on commit 0ed9ad7

Please sign in to comment.