Skip to content

Commit 4d4c819

Browse files
committed
fix(scoring): default to datetime.min when comparing datetimes
use `datetime.min` instead of `0` when comparing run time for the latest profiling and test runs.
1 parent 40b1e6c commit 4d4c819

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

testgen/ui/views/score_explorer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
from io import BytesIO
23
from typing import ClassVar
34

@@ -246,7 +247,7 @@ def save_score_definition(_) -> None:
246247
latest_run = max(
247248
profiling_queries.get_latest_run_date(project_code),
248249
test_run_queries.get_latest_run_date(project_code),
249-
key=lambda run: getattr(run, "run_time", 0),
250+
key=lambda run: getattr(run, "run_time", datetime.min),
250251
)
251252

252253
refresh_kwargs = {

0 commit comments

Comments
 (0)