File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,15 @@ def from_payloads(
384384 ) from err
385385 return values
386386
387+ def with_context (self , context : Optional [SerializationContext ]) -> Self :
388+ instance = type (self ).__new__ (type (self ))
389+ converters = [
390+ c .with_context (context ) if isinstance (c , WithSerializationContext ) else c
391+ for c in self .converters .values ()
392+ ]
393+ CompositePayloadConverter .__init__ (instance , * converters )
394+ return instance
395+
387396
388397class DefaultPayloadConverter (CompositePayloadConverter ):
389398 """Default payload converter compatible with other Temporal SDKs.
Original file line number Diff line number Diff line change 55from dataclasses import dataclass , field
66from typing import Any , Optional , Type
77
8- from typing_extensions import Self
9-
108from temporalio import workflow
119from temporalio .api .common .v1 import Payload
1210from temporalio .client import Client
@@ -80,15 +78,6 @@ def __init__(self):
8078 * DefaultPayloadConverter .default_encoding_payload_converters ,
8179 )
8280
83- def with_context (self , context : Optional [SerializationContext ]) -> Self :
84- instance = type (self ).__new__ (type (self ))
85- converters = [
86- c .with_context (context ) if isinstance (c , WithSerializationContext ) else c
87- for c in self .converters .values ()
88- ]
89- CompositePayloadConverter .__init__ (instance , * converters )
90- return instance
91-
9281
9382data_converter = dataclasses .replace (
9483 DataConverter .default ,
You can’t perform that action at this time.
0 commit comments