Skip to content

Commit

Permalink
Fix dead letter event null result
Browse files Browse the repository at this point in the history
  • Loading branch information
emilioalvap committed Jul 10, 2024
1 parent b5861ce commit 7b2653a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shippers/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _send_dead_letter_index(self, actions: list[Any]) -> list[Any]:

def _encode_dead_letter(self, outcome: dict[str, Any]) -> dict[str, Any]:
if "action" not in outcome or "error" not in outcome:
return {}
return None

# Assign random id in case bulk() results in error, it can be matched to the original
# action
Expand All @@ -291,7 +291,7 @@ def _encode_dead_letter(self, outcome: dict[str, Any]) -> dict[str, Any]:

def _decode_dead_letter(self, dead_letter_outcome: dict[str, Any]) -> dict[str, Any]:
if "action" not in dead_letter_outcome or "message" not in dead_letter_outcome["action"]:
return {}
return None

return {"action": json_parser(dead_letter_outcome["action"]["message"])}

Expand Down

0 comments on commit 7b2653a

Please sign in to comment.