@@ -401,6 +401,7 @@ class RPClient(RP):
401
401
_skip_analytics : str
402
402
_item_stack : LifoQueue
403
403
_log_batcher : LogBatcher [RPRequestLog ]
404
+ is_rerun : bool
404
405
405
406
@property
406
407
def launch_uuid (self ) -> Optional [str ]:
@@ -523,6 +524,7 @@ def __init__(
523
524
self .launch_uuid_print = launch_uuid_print
524
525
self .print_output = print_output
525
526
self .truncate_attributes = truncate_attributes
527
+ self .is_rerun = False # will be updated in start_launch
526
528
527
529
self .api_key = api_key
528
530
if not self .api_key :
@@ -567,7 +569,8 @@ def start_launch(
567
569
'rerun' option.
568
570
:return: Launch UUID if successfully started or None.
569
571
"""
570
- if not self .use_own_launch :
572
+ self .is_rerun = rerun
573
+ if not self .use_own_launch and not self .is_rerun :
571
574
return self .launch_uuid
572
575
url = uri_join (self .base_url_v2 , "launch" )
573
576
request_payload = LaunchStartRequest (
@@ -576,6 +579,7 @@ def start_launch(
576
579
attributes = verify_value_length (attributes ) if self .truncate_attributes else attributes ,
577
580
description = description ,
578
581
mode = self .mode ,
582
+ uuid = self .launch_uuid ,
579
583
rerun = rerun ,
580
584
rerun_of = rerun_of ,
581
585
).payload
@@ -745,7 +749,7 @@ def finish_launch(
745
749
PASSED, FAILED, STOPPED, SKIPPED, CANCELLED
746
750
:param attributes: Launch attributes
747
751
"""
748
- if self .use_own_launch :
752
+ if self .use_own_launch or self . is_rerun :
749
753
if self .launch_uuid is NOT_FOUND or not self .launch_uuid :
750
754
logger .warning ("Attempt to finish non-existent launch" )
751
755
return
0 commit comments