Skip to content

Commit a5d99b0

Browse files
committed
Update client.py
1 parent fa8c781 commit a5d99b0

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

distributed/client.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,21 @@ def executor(self):
358358
return self.client
359359

360360
@property
361-
def status(self):
361+
def status(
362+
self,
363+
) -> Literal["pending", "cancelled", "finished", "lost", "error"] | None:
362364
"""Returns the status
363365
364366
Returns
365367
-------
366-
str
367-
The status
368+
str or None
369+
The status of the future. Possible values:
370+
- "pending": The future is waiting to be computed
371+
- "finished": The future has completed successfully
372+
- "error": The future encountered an error during computation
373+
- "cancelled": The future was cancelled
374+
- "lost": The future's data was lost from memory
375+
- None: The future is not yet bound to a client
368376
"""
369377
if self._state:
370378
return self._state.status
@@ -645,7 +653,9 @@ def __init__(self, key: str):
645653
self._event = None
646654
self.key = key
647655
self.exception = None
648-
self.status = "pending"
656+
self.status: Literal["pending", "cancelled", "finished", "lost", "error"] = (
657+
"pending"
658+
)
649659
self.traceback = None
650660
self.type = None
651661

0 commit comments

Comments
 (0)