Skip to content

Commit 27abe2b

Browse files
committed
feedback
Signed-off-by: Fabian Martinez <[email protected]>
1 parent d7e30eb commit 27abe2b

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

durabletask/task.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,8 @@ def is_replaying(self) -> bool:
7171
"""
7272
pass
7373

74-
@property
75-
@abstractmethod
76-
def custom_status(self) -> str:
77-
"""Get the custom status.
78-
"""
79-
pass
80-
81-
@custom_status.setter
8274
@abstractmethod
83-
def custom_status(self, custom_status: str) -> None:
75+
def set_custom_status(self, custom_status: str) -> None:
8476
"""Set the custom status.
8577
"""
8678
pass

durabletask/worker.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,7 @@ def is_replaying(self) -> bool:
356356
def current_utc_datetime(self, value: datetime):
357357
self._current_utc_datetime = value
358358

359-
@property
360-
def custom_status(self) -> str:
361-
return self._custom_status
362-
363-
@custom_status.setter
364-
def custom_status(self, custom_status: str) -> None:
359+
def set_custom_status(self, custom_status: str) -> None:
365360
self._custom_status = custom_status
366361

367362
def create_timer(self, fire_at: Union[datetime, timedelta]) -> task.Task:
@@ -510,7 +505,7 @@ def execute(self, instance_id: str, old_events: Sequence[pb.HistoryEvent], new_e
510505
actions = ctx.get_actions()
511506
if self._logger.level <= logging.DEBUG:
512507
self._logger.debug(f"{instance_id}: Returning {len(actions)} action(s): {_get_action_summary(actions)}")
513-
return actions, ctx.custom_status
508+
return actions, ctx._custom_status
514509

515510
def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEvent) -> None:
516511
if self._is_suspended and _is_suspendable(event):

tests/test_orchestration_e2e.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def throw_activity(ctx: task.ActivityContext, _):
445445
def test_custom_status():
446446

447447
def empty_orchestrator(ctx: task.OrchestrationContext, _):
448-
ctx.custom_status = "foobaz"
448+
ctx.set_custom_status("foobaz")
449449

450450
# Start a worker, which will connect to the sidecar in a background thread
451451
with worker.TaskHubGrpcWorker() as w:
@@ -463,4 +463,4 @@ def empty_orchestrator(ctx: task.OrchestrationContext, _):
463463
assert state.runtime_status == client.OrchestrationStatus.COMPLETED
464464
assert state.serialized_input is None
465465
assert state.serialized_output is None
466-
assert state.serialized_custom_status is "foobaz"
466+
assert state.serialized_custom_status is "\"foobaz\""

0 commit comments

Comments
 (0)