Page MenuHomePhabricator

Fix stats calculation for runs with missing start and end events
ClosedPublic

Authored by sashank on Dec 20 2019, 6:50 PM.

Details

Summary

Previously, the event log for a run did not contain an event for PIPELINE_START or PIPELINE_SUCCESS | PIPELINE_FAILURE, then SqlEventLogStorage.get_stats_for_run would throw an error.

The error would be thrown because we convert start and end datetime object into floats, but in the case these events were missing, we would attempt to convert None.

This diff checks if the times exist, and then pass the datetime to date_time_as_float

Test Plan

unit

Diff Detail

Repository
R1 dagster
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

can we write an explicit test for this?

This revision now requires changes to proceed.Dec 20 2019, 7:25 PM

Just added the test in the next diff in the stack (https://dagster.phacility.com/D1725) since that diff parameterizes the tests.

This revision is now accepted and ready to land.Jan 6 2020, 11:00 PM