Skip to content

Commit 4f0026b

Browse files
committed
Update converter.py dataclassed to match C#
1 parent 15cfaf9 commit 4f0026b

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

temporalio/converter.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ class SerializationContext(ABC):
8181
class WorkflowSerializationContext(SerializationContext):
8282
"""Serialization context for workflows.
8383
84+
Matches .NET SDK's ISerializationContext.Workflow.
85+
8486
Attributes:
85-
workflow_id: The workflow ID.
86-
run_id: The workflow run ID.
87-
workflow_type: The type/name of the workflow.
88-
task_queue: The task queue the workflow is running on.
8987
namespace: The namespace the workflow is running in.
90-
attempt: The current workflow task attempt number (starting from 1).
88+
workflow_id: The workflow ID. Note, when creating/describing schedules,
89+
this may be the workflow ID prefix as configured, not the final
90+
workflow ID when the workflow is created by the schedule.
9191
"""
9292

9393
namespace: str
@@ -98,18 +98,24 @@ class WorkflowSerializationContext(SerializationContext):
9898
class ActivitySerializationContext(SerializationContext):
9999
"""Serialization context for activities.
100100
101+
Matches .NET SDK's ISerializationContext.Activity.
102+
101103
Attributes:
102-
activity_id: The ID of the activity.
103-
activity_type: The type/name of the activity.
104-
attempt: The current attempt number (starting from 1).
105-
is_local: Whether this is a local activity.
104+
namespace: Workflow/activity namespace.
105+
workflow_id: Workflow ID. Note, when creating/describing schedules,
106+
this may be the workflow ID prefix as configured, not the final
107+
workflow ID when the workflow is created by the schedule.
108+
workflow_type: Workflow Type.
109+
activity_type: Activity Type.
110+
activity_task_queue: Activity task queue.
111+
is_local: Whether the activity is a local activity.
106112
"""
107113

108114
namespace: str
109115
workflow_id: str
110116
workflow_type: str
111117
activity_type: str
112-
activity_task_queue: Optional[str]
118+
activity_task_queue: str
113119
is_local: bool
114120

115121

@@ -127,16 +133,6 @@ class WithSerializationContext(ABC):
127133
during serialization and deserialization.
128134
"""
129135

130-
operation: str
131-
service: str
132-
endpoint: str
133-
request_id: str
134-
workflow_task_completed_event_id: int
135-
endpoint_id: str
136-
schedule_to_close_timeout: timedelta
137-
cancellation_type: temporalio.workflow.NexusOperationCancellationType
138-
headers: Mapping[str, str]
139-
140136
def with_context(self, context: Optional[SerializationContext]) -> Self:
141137
"""Return a copy of this object configured to use the given context.
142138

0 commit comments

Comments
 (0)