Skip to content

Commit d48c50f

Browse files
committed
Use fully qualified system Nexus service registry keys
1 parent 1b4bace commit d48c50f

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

temporalio/nexus/system/__init__.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
from temporalio.converter import BinaryProtoPayloadConverter, CompositePayloadConverter
1414
from temporalio.nexus.system import workflow_service
1515

16-
_SERVICE_ALIASES = {
17-
"WorkflowService": "temporal.api.workflowservice.v1.WorkflowService",
18-
}
19-
2016

2117
class SystemNexusPayloadConverter(CompositePayloadConverter):
2218
"""Payload converter for system Nexus outer envelopes."""
@@ -26,23 +22,10 @@ def __init__(self) -> None:
2622
super().__init__(BinaryProtoPayloadConverter())
2723

2824

29-
def _operation_registry() -> dict[
30-
tuple[str, str], nexusrpc.Operation[typing.Any, typing.Any]
31-
]:
32-
registry = dict(workflow_service.__nexus_operation_registry__)
33-
for (
34-
service,
35-
operation,
36-
), operation_def in workflow_service.__nexus_operation_registry__.items():
37-
if alias := _SERVICE_ALIASES.get(service):
38-
registry[(alias, operation)] = operation_def
39-
return registry
40-
41-
4225
def _operation(
4326
service: str, operation: str
4427
) -> nexusrpc.Operation[typing.Any, typing.Any] | None:
45-
return _operation_registry().get((service, operation))
28+
return workflow_service.__nexus_operation_registry__.get((service, operation))
4629

4730

4831
async def visit_payload(

temporalio/nexus/system/workflow_service/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
__nexus_operation_registry__ = {
1414
(
15-
"WorkflowService",
15+
"temporal.api.workflowservice.v1.WorkflowService",
1616
"SignalWithStartWorkflowExecution",
1717
): _service.WorkflowService.signal_with_start_workflow,
1818
}

0 commit comments

Comments
 (0)