Skip to content

Commit 8f8e683

Browse files
committed
Revert additional changes for compilation against 1.1.0
1 parent 485068d commit 8f8e683

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

temporalio/worker/_interceptor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def __post_init__(self) -> None:
306306
if isinstance(self.operation, nexusrpc.Operation):
307307
self.output_type = self.operation.output_type
308308
elif callable(self.operation):
309-
if op := nexusrpc.get_operation(self.operation):
309+
if op := nexusrpc.get_operation_definition(self.operation):
310310
self.output_type = op.output_type
311311
else:
312312
raise ValueError(
@@ -325,7 +325,7 @@ def operation_name(self) -> str:
325325
elif isinstance(self.operation, str):
326326
return self.operation
327327
elif callable(self.operation):
328-
if op := nexusrpc.get_operation(self.operation):
328+
if op := nexusrpc.get_operation_definition(self.operation):
329329
return op.name
330330
else:
331331
raise ValueError(

tests/nexus/test_dynamic_creation_of_user_handler_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ async def test_run_nexus_service_from_programmatically_created_service_handler(
7676
service_handler = nexusrpc.handler._core.ServiceHandler(
7777
service=nexusrpc.ServiceDefinition(
7878
name="MyService",
79-
operation_definitions={
80-
"increment": nexusrpc.OperationDefinition[int, int](
79+
operations={
80+
"increment": nexusrpc.Operation[int, int](
8181
name="increment",
8282
method_name="increment",
8383
input_type=int,

tests/nexus/test_handler_operation_definitions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ async def test_collected_operation_names(
9595
assert isinstance(service_defn, nexusrpc.ServiceDefinition)
9696
assert service_defn.name == "Service"
9797
for method_name, expected_op in test_case.expected_operations.items():
98-
actual_op = nexusrpc.get_operation(getattr(test_case.Service, method_name))
98+
actual_op = nexusrpc.get_operation_definition(
99+
getattr(test_case.Service, method_name)
100+
)
99101
assert isinstance(actual_op, nexusrpc.Operation)
100102
assert actual_op.name == expected_op.name
101103
assert actual_op.input_type == expected_op.input_type

0 commit comments

Comments
 (0)