Skip to content

Commit bc1ad6a

Browse files
committed
Add warning about encode_failure
1 parent cc83c07 commit bc1ad6a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

temporalio/converter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,17 @@ async def decode_wrapper(self, payloads: temporalio.api.common.v1.Payloads) -> N
689689
payloads.payloads.extend(new_payloads)
690690

691691
async def encode_failure(self, failure: temporalio.api.failure.v1.Failure) -> None:
692-
"""Encode payloads of a failure."""
692+
"""Encode payloads of a failure. Intended as a helper method, not for overriding.
693+
It is not guaranteed that all failures will be encoded with this method rather
694+
than encoding the underlying payloads.
695+
"""
693696
await self._apply_to_failure_payloads(failure, self.encode_wrapper)
694697

695698
async def decode_failure(self, failure: temporalio.api.failure.v1.Failure) -> None:
696-
"""Decode payloads of a failure."""
699+
"""Decode payloads of a failure. Intended as a helper method, not for overriding.
700+
It is not guaranteed that all failures will be decoded with this method rather
701+
than decoding the underlying payloads.
702+
"""
697703
await self._apply_to_failure_payloads(failure, self.decode_wrapper)
698704

699705
async def _apply_to_failure_payloads(

0 commit comments

Comments
 (0)