Commit c03ce8c 1 parent da6090b commit c03ce8c Copy full SHA for c03ce8c
File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -234,12 +234,22 @@ async def __aenter__(self) -> "Runner":
234
234
return self
235
235
236
236
def __get_executing_run (self , tfp_metadata_pathspec , command_obj ):
237
+ # When two 'Runner' executions are done sequentially i.e. one after the other
238
+ # the 2nd run kinda uses the 1st run's previously set metadata and
239
+ # environment variables.
240
+
241
+ # It is thus necessary to set them to correct values before we return
242
+ # the Run object.
237
243
try :
244
+ # Set the environment variables to what they were before the run executed.
238
245
clear_and_set_os_environ (self .old_env )
246
+
247
+ # Set the correct metadata from the runner_attribute file corresponding to this run.
239
248
content = read_from_file_when_ready (tfp_metadata_pathspec .name , timeout = 5 )
240
249
metadata_for_flow , pathspec = content .split (":" , maxsplit = 1 )
241
- # set the current metadata from the metadata_pathspec file
242
250
metadata (metadata_for_flow )
251
+
252
+ # Finally, create the Run object.
243
253
run_object = Run (pathspec , _namespace_check = False )
244
254
return ExecutingRun (self , command_obj , run_object )
245
255
except TimeoutError as e :
You can’t perform that action at this time.
0 commit comments