Skip to content

Commit

Permalink
Satisfy pydocstyle linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jun 21, 2024
1 parent 5213d84 commit 7e1fc7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions temporalio/worker/_workflow_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2739,17 +2739,21 @@ class _WorkflowBeingEvictedError(BaseException):

@dataclass
class HandlerExecution:
"""Information about an execution of a signal or update handler."""
name: str
unfinished_handlers_policy: temporalio.workflow.UnfinishedHandlersPolicy
id: Optional[str] = None


class UnfinishedUpdateHandlerWarning(RuntimeWarning):
"""Warning issued when a workflow exits before an update handler has finished executing"""
def __init__(self, handler_executions: List[HandlerExecution]) -> None:
"""Initialize warning object"""
super().__init__()
self.handler_executions = handler_executions

def __str__(self) -> str:
"""Return warning message"""
message = """
Workflow finished while update handlers are still running. This may have interrupted work that the
update handler was doing, and the client that sent the update will receive a 'workflow execution
Expand All @@ -2771,11 +2775,14 @@ def __str__(self) -> str:


class UnfinishedSignalHandlerWarning(RuntimeWarning):
"""Warning issued when a workflow exits before a signal handler has finished executing"""
def __init__(self, handler_executions: List[HandlerExecution]) -> None:
"""Initialize warning object"""
super().__init__()
self.handler_executions = handler_executions

def __str__(self) -> str:
"""Return warning message"""
message = """
Workflow finished while signal handlers are still running. This may have interrupted work that the
signal handler was doing. You can wait for all update and signal handlers to complete by using
Expand Down

0 comments on commit 7e1fc7b

Please sign in to comment.