mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
Fixes typing error identified by a new mypy release (#129)
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
import datetime
|
||||
from typing import List, Optional, Tuple
|
||||
from uuid import UUID
|
||||
|
||||
@ -16,7 +17,8 @@ class TaskEvent(BASE_TASK_EVENT, ORMMixin):
|
||||
@classmethod
|
||||
def get_summary(cls, task_id: UUID) -> List[TaskEventSummary]:
|
||||
events = cls.search(query={"task_id": [task_id]})
|
||||
events.sort(key=lambda e: e.Timestamp)
|
||||
# handle None case of Optional[e.Timestamp], which shouldn't happen
|
||||
events.sort(key=lambda e: e.Timestamp or datetime.datetime.max)
|
||||
|
||||
return [
|
||||
TaskEventSummary(
|
||||
|
Reference in New Issue
Block a user