Recover step output value

in WorkflowProgress instance. Fixes running subworkflows with
parameter_input steps.
Fixes https://github.com/galaxyproject/galaxy/issues/8390 and
allows us to get rid of one FIXME I added when working around
https://github.com/galaxyproject/galaxy/issues/8248.
This commit is contained in:
mvdbeek
2020-11-15 13:23:12 +01:00
parent 1233da0544
commit 6b3d13e427
2 changed files with 14 additions and 10 deletions
+8
View File
@@ -2625,6 +2625,14 @@ simple_mapping(
simple_mapping(
model.WorkflowInvocationOutputValue,
workflow_invocation=relation(model.WorkflowInvocation, backref="output_values"),
workflow_invocation_step=relation(model.WorkflowInvocationStep,
foreign_keys=[model.WorkflowInvocationStep.table.c.workflow_invocation_id, model.WorkflowInvocationStep.table.c.workflow_step_id],
primaryjoin=and_(
model.WorkflowInvocationStep.table.c.workflow_invocation_id == model.WorkflowInvocationOutputValue.table.c.workflow_invocation_id,
model.WorkflowInvocationStep.table.c.workflow_step_id == model.WorkflowInvocationOutputValue.table.c.workflow_step_id,
),
backref='output_value'
),
workflow_step=relation(model.WorkflowStep),
workflow_output=relation(model.WorkflowOutput),
)
+6 -10
View File
@@ -352,16 +352,10 @@ class WorkflowProgress:
try:
replacement = step_outputs[output_name]
except KeyError:
replacement = self.inputs_by_step_id.get(output_step_id)
if connection.output_step.type == 'parameter_input' and output_step_id is not None:
# FIXME: parameter_input step outputs should be properly recorded as step outputs, but for now we can
# short-circuit and just pick the input value
pass
else:
# Must resolve.
template = "Workflow evaluation problem - failed to find output_name %s in step_outputs %s"
message = template % (output_name, step_outputs)
raise Exception(message)
# Must resolve.
template = "Workflow evaluation problem - failed to find output_name %s in step_outputs %s"
message = template % (output_name, step_outputs)
raise Exception(message)
if isinstance(replacement, model.HistoryDatasetCollectionAssociation):
if not replacement.collection.populated:
if not replacement.waiting_for_elements:
@@ -428,6 +422,8 @@ class WorkflowProgress:
def set_step_outputs(self, invocation_step, outputs, already_persisted=False):
step = invocation_step.workflow_step
if invocation_step.output_value:
outputs[invocation_step.output_value.workflow_output.output_name] = invocation_step.output_value.value
self.outputs[step.id] = outputs
if not already_persisted:
for output_name, output_object in outputs.items():