From a5d99b0ed8e2a32cc0aaeb869f53f4a5780a887a Mon Sep 17 00:00:00 2001 From: nadzhou Date: Sun, 1 Feb 2026 15:45:56 -0800 Subject: [PATCH 1/2] Update client.py --- distributed/client.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/distributed/client.py b/distributed/client.py index bc39b956d2..adc71e1a13 100644 --- a/distributed/client.py +++ b/distributed/client.py @@ -358,13 +358,21 @@ def executor(self): return self.client @property - def status(self): + def status( + self, + ) -> Literal["pending", "cancelled", "finished", "lost", "error"] | None: """Returns the status Returns ------- - str - The status + str or None + The status of the future. Possible values: + - "pending": The future is waiting to be computed + - "finished": The future has completed successfully + - "error": The future encountered an error during computation + - "cancelled": The future was cancelled + - "lost": The future's data was lost from memory + - None: The future is not yet bound to a client """ if self._state: return self._state.status @@ -645,7 +653,9 @@ def __init__(self, key: str): self._event = None self.key = key self.exception = None - self.status = "pending" + self.status: Literal["pending", "cancelled", "finished", "lost", "error"] = ( + "pending" + ) self.traceback = None self.type = None From c031121b8541114efb01aa175364d769e3d22663 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Feb 2026 13:50:31 +0000 Subject: [PATCH 2/2] Apply suggestion from @crusaderky --- distributed/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/distributed/client.py b/distributed/client.py index adc71e1a13..19e4e2a821 100644 --- a/distributed/client.py +++ b/distributed/client.py @@ -367,6 +367,7 @@ def status( ------- str or None The status of the future. Possible values: + - "pending": The future is waiting to be computed - "finished": The future has completed successfully - "error": The future encountered an error during computation