@@ -545,10 +545,6 @@ def _batch(self, node):
545
545
"Parallel steps are not supported yet with AWS step functions."
546
546
)
547
547
548
- # Inherit the run id from the parent and pass it along to children.
549
- attrs ["metaflow.run_id.$" ] = "$.Parameters.run_id"
550
- attrs ["run_id.$" ] = "$.Parameters.run_id"
551
-
552
548
# Handle foreach join.
553
549
if (
554
550
node .type == "join"
@@ -572,6 +568,9 @@ def _batch(self, node):
572
568
env ["METAFLOW_SPLIT_PARENT_TASK_ID" ] = (
573
569
"$.Parameters.split_parent_task_id_%s" % node .split_parents [- 1 ]
574
570
)
571
+ # Inherit the run id from the parent and pass it along to children.
572
+ attrs ["metaflow.run_id.$" ] = "$.Parameters.run_id"
573
+ attrs ["run_id.$" ] = "$.Parameters.run_id"
575
574
else :
576
575
# Set appropriate environment variables for runtime replacement.
577
576
if len (node .in_funcs ) == 1 :
@@ -580,6 +579,9 @@ def _batch(self, node):
580
579
% node .in_funcs [0 ]
581
580
)
582
581
env ["METAFLOW_PARENT_TASK_ID" ] = "$.JobId"
582
+ # Inherit the run id from the parent and pass it along to children.
583
+ attrs ["metaflow.run_id.$" ] = "$.Parameters.run_id"
584
+ attrs ["run_id.$" ] = "$.Parameters.run_id"
583
585
else :
584
586
# Generate the input paths in a quasi-compressed format.
585
587
# See util.decompress_list for why this is written the way
@@ -589,6 +591,9 @@ def _batch(self, node):
589
591
"${METAFLOW_PARENT_%s_TASK_ID}" % (idx , idx )
590
592
for idx , _ in enumerate (node .in_funcs )
591
593
)
594
+ # Inherit the run id from the parent and pass it along to children.
595
+ attrs ["metaflow.run_id.$" ] = "$.[0].Parameters.run_id"
596
+ attrs ["run_id.$" ] = "$.[0].Parameters.run_id"
592
597
for idx , _ in enumerate (node .in_funcs ):
593
598
env ["METAFLOW_PARENT_%s_TASK_ID" % idx ] = "$.[%s].JobId" % idx
594
599
env ["METAFLOW_PARENT_%s_STEP" % idx ] = (
0 commit comments