Skip to content

Commit

Permalink
chore: fix type hints in thread decorator
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
  • Loading branch information
dbluhm committed Mar 22, 2024
1 parent 8171049 commit f74d4e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions aries_cloudagent/messaging/agent_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _thread(self) -> ThreadDecorator:
return self._decorators.get("thread")

@_thread.setter
def _thread(self, val: Union[ThreadDecorator, dict]):
def _thread(self, val: Union[ThreadDecorator, dict, None]):
"""Setter for the message's thread decorator.
Args:
Expand Down Expand Up @@ -335,7 +335,7 @@ def assign_thread_from(self, msg: "AgentMessage"):
pthid = thread and thread.pthid
self.assign_thread_id(thid, pthid)

def assign_thread_id(self, thid: str, pthid: str = None):
def assign_thread_id(self, thid: str, pthid: Optional[str] = None):
"""Assign a specific thread ID.
Args:
Expand Down
10 changes: 5 additions & 5 deletions aries_cloudagent/messaging/decorators/thread_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context from previous messages.
"""

from typing import Mapping
from typing import Mapping, Optional

from marshmallow import EXCLUDE, fields

Expand All @@ -23,10 +23,10 @@ class Meta:
def __init__(
self,
*,
thid: str = None,
pthid: str = None,
sender_order: int = None,
received_orders: Mapping = None,
thid: Optional[str] = None,
pthid: Optional[str] = None,
sender_order: Optional[int] = None,
received_orders: Optional[Mapping] = None,
):
"""Initialize a ThreadDecorator instance.
Expand Down

0 comments on commit f74d4e3

Please sign in to comment.