mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 12:28: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.
|
# Copyright (c) Microsoft Corporation.
|
||||||
# Licensed under the MIT License.
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
|
import datetime
|
||||||
from typing import List, Optional, Tuple
|
from typing import List, Optional, Tuple
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
@ -16,7 +17,8 @@ class TaskEvent(BASE_TASK_EVENT, ORMMixin):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_summary(cls, task_id: UUID) -> List[TaskEventSummary]:
|
def get_summary(cls, task_id: UUID) -> List[TaskEventSummary]:
|
||||||
events = cls.search(query={"task_id": [task_id]})
|
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 [
|
return [
|
||||||
TaskEventSummary(
|
TaskEventSummary(
|
||||||
|
Reference in New Issue
Block a user