|
3 | 3 | import contextvars |
4 | 4 | from contextlib import contextmanager |
5 | 5 | from dataclasses import dataclass |
6 | | -from typing import Any, Iterator, Optional, Type |
| 6 | +from typing import Iterator, Optional |
7 | 7 |
|
8 | 8 | from temporalio.api.enums.v1.command_type_pb2 import CommandType |
9 | 9 | from temporalio.bridge._visitor import PayloadVisitor, VisitorFunctions |
10 | | -from temporalio.bridge.proto.workflow_activation import workflow_activation_pb2 |
11 | 10 | from temporalio.bridge.proto.workflow_activation.workflow_activation_pb2 import ( |
12 | 11 | ResolveActivity, |
13 | 12 | ResolveChildWorkflowExecution, |
|
17 | 16 | ResolveRequestCancelExternalWorkflow, |
18 | 17 | ResolveSignalExternalWorkflow, |
19 | 18 | ) |
20 | | -from temporalio.bridge.proto.workflow_commands import workflow_commands_pb2 |
21 | 19 | from temporalio.bridge.proto.workflow_commands.workflow_commands_pb2 import ( |
22 | 20 | ScheduleActivity, |
23 | 21 | ScheduleLocalActivity, |
@@ -150,27 +148,13 @@ async def _visit_coresdk_workflow_activation_ResolveNexusOperation( |
150 | 148 | ) |
151 | 149 |
|
152 | 150 |
|
153 | | -def _get_workflow_command_protos_with_seq() -> Iterator[Type[Any]]: |
154 | | - """Get concrete classes of all workflow command protos with a seq field.""" |
155 | | - for descriptor in workflow_commands_pb2.DESCRIPTOR.message_types_by_name.values(): |
156 | | - if "seq" in descriptor.fields_by_name: |
157 | | - yield descriptor._concrete_class |
158 | | - |
159 | | - |
160 | | -def _get_workflow_activation_job_protos_with_seq() -> Iterator[Type[Any]]: |
161 | | - """Get concrete classes of all workflow activation job protos with a seq field.""" |
162 | | - for descriptor in workflow_activation_pb2.DESCRIPTOR.message_types_by_name.values(): |
163 | | - if "seq" in descriptor.fields_by_name: |
164 | | - yield descriptor._concrete_class |
165 | | - |
166 | | - |
167 | 151 | @contextmanager |
168 | 152 | def current_command( |
169 | | - command_type: Optional[CommandType.ValueType], command_seq: int |
| 153 | + command_type: CommandType.ValueType, command_seq: int |
170 | 154 | ) -> Iterator[None]: |
171 | 155 | """Context manager for setting command info.""" |
172 | 156 | token = current_command_info.set( |
173 | | - CommandInfo(command_type=command_type, command_seq=command_seq) # type: ignore |
| 157 | + CommandInfo(command_type=command_type, command_seq=command_seq) |
174 | 158 | ) |
175 | 159 | try: |
176 | 160 | yield |
|
0 commit comments