Skip to content

Commit e3a0a3b

Browse files
committed
wire context: WorkflowHandle data converter
1 parent 37df8a8 commit e3a0a3b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

temporalio/client.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,11 @@ def __init__(
15831583
) -> None:
15841584
"""Create workflow handle."""
15851585
self._client = client
1586+
self._data_converter = client.data_converter._with_context(
1587+
temporalio.converter.WorkflowSerializationContext(
1588+
namespace=client.namespace, workflow_id=id
1589+
)
1590+
)
15861591
self._id = id
15871592
self._run_id = run_id
15881593
self._result_run_id = result_run_id
@@ -1692,7 +1697,7 @@ async def result(
16921697
break
16931698
# Ignoring anything after the first response like TypeScript
16941699
type_hints = [self._result_type] if self._result_type else None
1695-
results = await self._client.data_converter.decode_wrapper(
1700+
results = await self._data_converter.decode_wrapper(
16961701
complete_attr.result,
16971702
type_hints,
16981703
)
@@ -1708,7 +1713,7 @@ async def result(
17081713
hist_run_id = fail_attr.new_execution_run_id
17091714
break
17101715
raise WorkflowFailureError(
1711-
cause=await self._client.data_converter.decode_failure(
1716+
cause=await self._data_converter.decode_failure(
17121717
fail_attr.failure
17131718
),
17141719
)
@@ -1718,7 +1723,7 @@ async def result(
17181723
cause=temporalio.exceptions.CancelledError(
17191724
"Workflow cancelled",
17201725
*(
1721-
await self._client.data_converter.decode_wrapper(
1726+
await self._data_converter.decode_wrapper(
17221727
cancel_attr.details
17231728
)
17241729
),
@@ -1730,7 +1735,7 @@ async def result(
17301735
cause=temporalio.exceptions.TerminatedError(
17311736
term_attr.reason or "Workflow terminated",
17321737
*(
1733-
await self._client.data_converter.decode_wrapper(
1738+
await self._data_converter.decode_wrapper(
17341739
term_attr.details
17351740
)
17361741
),

0 commit comments

Comments
 (0)