File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 66import asyncio
77import copy
88import dataclasses
9+ import functools
910import inspect
1011import json
1112import re
@@ -1598,11 +1599,6 @@ def __init__(
15981599 ) -> None :
15991600 """Create workflow handle."""
16001601 self ._client = client
1601- self ._data_converter = client .data_converter ._with_context (
1602- temporalio .converter .WorkflowSerializationContext (
1603- namespace = client .namespace , workflow_id = id
1604- )
1605- )
16061602 self ._id = id
16071603 self ._run_id = run_id
16081604 self ._result_run_id = result_run_id
@@ -1611,6 +1607,14 @@ def __init__(
16111607 self ._start_workflow_response = start_workflow_response
16121608 self .__temporal_eagerly_started = False
16131609
1610+ @functools .cached_property
1611+ def _data_converter (self ) -> temporalio .converter .DataConverter :
1612+ return self ._client .data_converter ._with_context (
1613+ temporalio .converter .WorkflowSerializationContext (
1614+ namespace = self ._client .namespace , workflow_id = self ._id
1615+ )
1616+ )
1617+
16141618 @property
16151619 def id (self ) -> str :
16161620 """ID for the workflow."""
You can’t perform that action at this time.
0 commit comments