Skip to content

Commit

Permalink
Fix Code Quality check by updating the typing
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandarmijat committed May 22, 2024
1 parent ab28db7 commit 4866d7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rasa_sdk/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def __init__(self) -> None:
self.actions: Dict[Text, Callable] = {}
self._modules: Dict[Text, TimestampModule] = {}
self._loaded: Set[Type[Action]] = set()
self.domain: Dict[Text, Any] = None
self.domain_digest: Text = None
self.domain: Optional[Dict[Text, Any]] = None
self.domain_digest: Optional[Text] = None

def register_action(self, action: Union[Type[Action], Action]) -> None:
if inspect.isclass(action):
Expand Down Expand Up @@ -386,7 +386,7 @@ def validate_events(events: List[Dict[Text, Any]], action_name: Text):
# we won't append this to validated events -> will be ignored
return validated

def is_domain_digest_valid(self, domain_digest: Text) -> bool:
def is_domain_digest_valid(self, domain_digest: Optional[Text]) -> bool:
"""Check if the domain_digest is valid
If the domain_digest is empty or different from the one provided, it is invalid.
Expand All @@ -401,7 +401,7 @@ def is_domain_digest_valid(self, domain_digest: Text) -> bool:

def update_and_return_domain(
self, payload: Dict[Text, Any], action_name: Text
) -> Dict[Text, Any]:
) -> Optional[Dict[Text, Any]]:
"""Validate the digest, store the domain if available, and return the domain.
This method validates the domain digest from the payload.
Expand Down Expand Up @@ -436,7 +436,7 @@ def update_and_return_domain(

return self.domain

async def run(self, action_call: "ActionCall") -> Optional[Dict[Text, Any]]:
async def run(self, action_call: Dict[Text, Any]) -> Optional[Dict[Text, Any]]:
from rasa_sdk.interfaces import Tracker

action_name = action_call.get("next_action")
Expand Down

0 comments on commit 4866d7c

Please sign in to comment.