@@ -1598,7 +1598,7 @@ def execute_branch(
15981598 result : Result ,
15991599 * ,
16001600 event : Optional [Event ] = None ,
1601- ) -> Result :
1601+ ) -> tuple [ Status , Result ] :
16021602 """Execute branch that will execute all nested-stage that was set in
16031603 this stage with specific branch ID.
16041604
@@ -1611,7 +1611,7 @@ def execute_branch(
16111611
16121612 :raise StageCancelError: If event was set.
16131613
1614- :rtype: Result
1614+ :rtype: tuple[Status, Result]
16151615 """
16161616 result .trace .debug (f"[STAGE]: Execute Branch: { branch !r} " )
16171617
@@ -1701,7 +1701,7 @@ def execute_branch(
17011701 raise StageCancelError (error_msg , refs = branch )
17021702
17031703 status : Status = SKIP if sum (skips ) == total_stage else SUCCESS
1704- return result .catch (
1704+ return status , result .catch (
17051705 status = status ,
17061706 parallel = {
17071707 branch : {
@@ -1760,7 +1760,7 @@ def execute(
17601760 statuses : list [Status ] = [WAIT ] * len_parallel
17611761 for i , future in enumerate (as_completed (futures ), start = 0 ):
17621762 try :
1763- statuses [i ] = future .result (). status
1763+ statuses [i ], _ = future .result ()
17641764 except StageError as e :
17651765 statuses [i ] = get_status_from_error (e )
17661766 self .mark_errors (context , e )
@@ -1827,7 +1827,7 @@ def execute_item(
18271827 result : Result ,
18281828 * ,
18291829 event : Optional [Event ] = None ,
1830- ) -> Result :
1830+ ) -> tuple [ Status , Result ] :
18311831 """Execute item that will execute all nested-stage that was set in this
18321832 stage with specific foreach item.
18331833
@@ -1849,7 +1849,7 @@ def execute_item(
18491849 :raise StageError: If the stage execution raise any Exception error.
18501850 :raise StageError: If the result from execution has `FAILED` status.
18511851
1852- :rtype: Result
1852+ :rtype: tuple[Status, Result]
18531853 """
18541854 result .trace .debug (f"[STAGE]: Execute Item: { item !r} " )
18551855 key : StrOrInt = index if self .use_index_as_key else item
@@ -1939,7 +1939,7 @@ def execute_item(
19391939 raise StageCancelError (error_msg , refs = key )
19401940
19411941 status : Status = SKIP if sum (skips ) == total_stage else SUCCESS
1942- return result .catch (
1942+ return status , result .catch (
19431943 status = status ,
19441944 foreach = {
19451945 key : {
@@ -2051,7 +2051,7 @@ def execute(
20512051
20522052 for i , future in enumerate (done , start = 0 ):
20532053 try :
2054- statuses [i ] = future .result (). status
2054+ statuses [i ], _ = future .result ()
20552055 except StageError as e :
20562056 statuses [i ] = get_status_from_error (e )
20572057 self .mark_errors (context , e )
@@ -2123,7 +2123,7 @@ def execute_loop(
21232123 params : DictData ,
21242124 result : Result ,
21252125 event : Optional [Event ] = None ,
2126- ) -> tuple [Result , T ]:
2126+ ) -> tuple [Status , Result , T ]:
21272127 """Execute loop that will execute all nested-stage that was set in this
21282128 stage with specific loop and item.
21292129
@@ -2134,7 +2134,7 @@ def execute_loop(
21342134 :param event: (Event) An Event manager instance that use to cancel this
21352135 execution if it forces stopped by parent execution.
21362136
2137- :rtype: tuple[Result, T]
2137+ :rtype: tuple[Status, Result, T]
21382138 :return: Return a pair of Result and changed item.
21392139 """
21402140 result .trace .debug (f"[STAGE]: Execute Loop: { loop } (Item { item !r} )" )
@@ -2234,6 +2234,7 @@ def execute_loop(
22342234
22352235 status : Status = SKIP if sum (skips ) == total_stage else SUCCESS
22362236 return (
2237+ status ,
22372238 result .catch (
22382239 status = status ,
22392240 until = {
@@ -2287,7 +2288,7 @@ def execute(
22872288 "Execution was canceled from the event before start loop."
22882289 )
22892290
2290- result , item = self .execute_loop (
2291+ status , result , item = self .execute_loop (
22912292 item = item ,
22922293 loop = loop ,
22932294 params = params ,
@@ -2320,7 +2321,7 @@ def execute(
23202321 f": { next_track !r} "
23212322 )
23222323 until_rs : bool = not next_track
2323- statuses .append (result . status )
2324+ statuses .append (status )
23242325 delay (0.005 )
23252326
23262327 if exceed_loop :
0 commit comments