Skip to content

Commit 33ea9fc

Browse files
committed
Respond to upstream: operation_handler is not in the public API
1 parent 4b0d7e8 commit 33ea9fc

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

tests/nexus/test_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
OperationErrorState,
4141
OperationHandler,
4242
StartOperationContext,
43-
operation_handler,
4443
service_handler,
4544
sync_operation,
4645
)
46+
from nexusrpc.handler._decorators import operation_handler
4747

4848
import temporalio.api.failure.v1
4949
from temporalio import nexus, workflow

tests/nexus/test_handler_async_operation.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
OperationHandler,
2424
StartOperationContext,
2525
StartOperationResultAsync,
26+
service_handler,
2627
)
28+
from nexusrpc.handler._decorators import operation_handler
2729

2830
from temporalio.testing import WorkflowEnvironment
2931
from temporalio.worker import Worker
@@ -109,21 +111,21 @@ def cancel(self, ctx: CancelOperationContext, token: str) -> None:
109111

110112

111113
@dataclass
112-
@nexusrpc.handler.service_handler
114+
@service_handler
113115
class MyServiceHandlerWithAsyncDefs:
114116
executor: TaskExecutor
115117

116-
@nexusrpc.handler.operation_handler
118+
@operation_handler
117119
def async_operation(self) -> OperationHandler[Input, Output]:
118120
return AsyncOperationWithAsyncDefs(self.executor)
119121

120122

121123
@dataclass
122-
@nexusrpc.handler.service_handler
124+
@service_handler
123125
class MyServiceHandlerWithNonAsyncDefs:
124126
executor: TaskExecutor
125127

126-
@nexusrpc.handler.operation_handler
128+
@operation_handler
127129
def async_operation(self) -> OperationHandler[Input, Output]:
128130
return AsyncOperationWithNonAsyncDefs(self.executor)
129131

tests/nexus/test_workflow_caller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
StartOperationContext,
1616
StartOperationResultAsync,
1717
StartOperationResultSync,
18-
operation_handler,
1918
service_handler,
2019
sync_operation,
2120
)
21+
from nexusrpc.handler._decorators import operation_handler
2222

2323
import temporalio.api
2424
import temporalio.api.common

tests/nexus/test_workflow_run_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
OperationHandler,
99
StartOperationContext,
1010
StartOperationResultAsync,
11-
operation_handler,
1211
service_handler,
1312
)
13+
from nexusrpc.handler._decorators import operation_handler
1414

1515
from temporalio import nexus, workflow
1616
from temporalio.nexus._operation_handlers import WorkflowRunOperationHandler

0 commit comments

Comments
 (0)