Skip to content

Commit 7c18d5b

Browse files
committed
Rename
1 parent 214b314 commit 7c18d5b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

temporalio/worker/_workflow_instance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ def workflow_last_completion_result(
17151715
self._last_completion_result.payloads[0], type_hint
17161716
)
17171717

1718-
def workflow_previous_run_failure(self) -> Optional[BaseException]:
1718+
def workflow_last_failure(self) -> Optional[BaseException]:
17191719
if self._previous_run_failure:
17201720
return self._failure_converter.from_failure(
17211721
self._previous_run_failure, self._payload_converter

temporalio/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ def workflow_last_completion_result(
907907
) -> Optional[Any]: ...
908908

909909
@abstractmethod
910-
def workflow_previous_run_failure(self) -> Optional[BaseException]: ...
910+
def workflow_last_failure(self) -> Optional[BaseException]: ...
911911

912912

913913
_current_update_info: contextvars.ContextVar[UpdateInfo] = contextvars.ContextVar(
@@ -1074,9 +1074,9 @@ def get_last_completion_result(type_hint: Optional[Type] = None) -> Optional[Any
10741074
return _Runtime.current().workflow_last_completion_result(type_hint)
10751075

10761076

1077-
def get_previous_run_failure() -> Optional[BaseException]:
1077+
def get_last_failure() -> Optional[BaseException]:
10781078
"""Get the last failure of the workflow."""
1079-
return _Runtime.current().workflow_previous_run_failure()
1079+
return _Runtime.current().workflow_last_failure()
10801080

10811081

10821082
def set_current_details(description: str) -> None:

tests/worker/test_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8334,7 +8334,7 @@ class PreviousRunFailureWorkflow:
83348334
@workflow.run
83358335
async def run(self) -> str:
83368336
if workflow.info().attempt != 1:
8337-
previous_failure = workflow.get_previous_run_failure()
8337+
previous_failure = workflow.get_last_failure()
83388338
assert isinstance(previous_failure, ApplicationError)
83398339
assert previous_failure.message == "Intentional Failure"
83408340
return "Done"

0 commit comments

Comments
 (0)