Skip to content

Commit 0be33c1

Browse files
committed
Verify that the state does not already contain the result.
This is really helpful when the state does not include a jobId because it avoids calling `get_state` which will fail [ch56069]
1 parent 804c0ed commit 0be33c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dataikuapi/dss/future.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def wait_for_result(self):
7272
"""
7373
Wait and get the future result
7474
"""
75+
if self.state.get('hasResult', False) and 'result' in self.state:
76+
return self.result_wrapper(self.state.get('result', None))
7577
if self.state is None or not self.state.get('hasResult', False) or self.state_is_peek:
7678
self.get_state()
7779
while not self.state.get('hasResult', False):

0 commit comments

Comments
 (0)