From 1b3361c7bc80b38260b659b2520eca74117afad3 Mon Sep 17 00:00:00 2001 From: kraju3 Date: Thu, 26 Sep 2024 08:32:26 -0500 Subject: [PATCH] Marking thread fields to Optional to address KeyErrors --- nylas/models/threads.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nylas/models/threads.py b/nylas/models/threads.py index 1485d3b..cc11f1f 100644 --- a/nylas/models/threads.py +++ b/nylas/models/threads.py @@ -65,13 +65,14 @@ class Thread: has_drafts: bool starred: bool unread: bool - earliest_message_date: int message_ids: List[str] folders: List[str] latest_draft_or_message: Union[Message, Draft] = field( + default=None, metadata=config(decoder=_decode_draft_or_message) ) object: str = "thread" + earliest_message_date: Optional[int] = None latest_message_received_date: Optional[int] = None draft_ids: Optional[List[str]] = None snippet: Optional[str] = None