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 @@ -248,12 +248,22 @@ async def __aenter__(self) -> "Runner":
248
248
return self
249
249
250
250
def __get_executing_run (self , tfp_metadata_pathspec , command_obj ):
251
+ # When two 'Runner' executions are done sequentially i.e. one after the other
252
+ # the 2nd run kinda uses the 1st run's previously set metadata and
253
+ # environment variables.
254
+
255
+ # It is thus necessary to set them to correct values before we return
256
+ # the Run object.
251
257
try :
258
+ # Set the environment variables to what they were before the run executed.
252
259
clear_and_set_os_environ (self .old_env )
260
+
261
+ # Set the correct metadata from the runner_attribute file corresponding to this run.
253
262
content = read_from_file_when_ready (tfp_metadata_pathspec .name , timeout = 10 )
254
263
metadata_for_flow , pathspec = content .split (":" , maxsplit = 1 )
255
- # set the current metadata from the metadata_pathspec file
256
264
metadata (metadata_for_flow )
265
+
266
+ # Finally, create the Run object.
257
267
run_object = Run (pathspec , _namespace_check = False )
258
268
return ExecutingRun (self , command_obj , run_object )
259
269
except TimeoutError as e :
You can’t perform that action at this time.
0 commit comments