Skip to content

Commit 296f344

Browse files
committed
wire context: WorkflowHandle data converter
1 parent 3beda9b commit 296f344

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
@@ -1592,6 +1592,11 @@ def __init__(
15921592
) -> None:
15931593
"""Create workflow handle."""
15941594
self._client = client
1595+
self._data_converter = client.data_converter._with_context(
1596+
temporalio.converter.WorkflowSerializationContext(
1597+
namespace=client.namespace, workflow_id=id
1598+
)
1599+
)
15951600
self._id = id
15961601
self._run_id = run_id
15971602
self._result_run_id = result_run_id
@@ -1701,7 +1706,7 @@ async def result(
17011706
break
17021707
# Ignoring anything after the first response like TypeScript
17031708
type_hints = [self._result_type] if self._result_type else None
1704-
results = await self._client.data_converter.decode_wrapper(
1709+
results = await self._data_converter.decode_wrapper(
17051710
complete_attr.result,
17061711
type_hints,
17071712
)
@@ -1717,7 +1722,7 @@ async def result(
17171722
hist_run_id = fail_attr.new_execution_run_id
17181723
break
17191724
raise WorkflowFailureError(
1720-
cause=await self._client.data_converter.decode_failure(
1725+
cause=await self._data_converter.decode_failure(
17211726
fail_attr.failure
17221727
),
17231728
)
@@ -1727,7 +1732,7 @@ async def result(
17271732
cause=temporalio.exceptions.CancelledError(
17281733
"Workflow cancelled",
17291734
*(
1730-
await self._client.data_converter.decode_wrapper(
1735+
await self._data_converter.decode_wrapper(
17311736
cancel_attr.details
17321737
)
17331738
),
@@ -1739,7 +1744,7 @@ async def result(
17391744
cause=temporalio.exceptions.TerminatedError(
17401745
term_attr.reason or "Workflow terminated",
17411746
*(
1742-
await self._client.data_converter.decode_wrapper(
1747+
await self._data_converter.decode_wrapper(
17431748
term_attr.details
17441749
)
17451750
),

0 commit comments

Comments
 (0)