diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index 7979491f616..a4aac395402 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -2163,8 +2163,10 @@ class PickValueModule(WorkflowModule): """Apply post job actions directly to module output via ActionBox. Uses execute_on_mapped_over which operates on step_outputs dict - rather than requiring a Job object. + rather than requiring a Job object. Skipped outputs are left untouched. """ + if self._is_null_or_skipped(output): + return step_outputs = {"output": output} step_inputs = {} for pja in step.post_job_actions: diff --git a/lib/galaxy_test/workflow/pick_value_skip_pja.gxwf-tests.yml b/lib/galaxy_test/workflow/pick_value_skip_pja.gxwf-tests.yml new file mode 100644 index 00000000000..333ff8ebbdf --- /dev/null +++ b/lib/galaxy_test/workflow/pick_value_skip_pja.gxwf-tests.yml @@ -0,0 +1,16 @@ +- doc: | + Test that PJAs are NOT applied to skipped outputs. When all inputs are + null, first_or_skip produces a skipped HDA (expression.json). The + ChangeDatatypeAction should not corrupt it. + job: + input_data: + type: File + value: 1.bed + file_type: bed + when: + type: raw + value: false + outputs: + picked: + class: File + ftype: expression.json diff --git a/lib/galaxy_test/workflow/pick_value_skip_pja.gxwf.yml b/lib/galaxy_test/workflow/pick_value_skip_pja.gxwf.yml new file mode 100644 index 00000000000..242217a9a43 --- /dev/null +++ b/lib/galaxy_test/workflow/pick_value_skip_pja.gxwf.yml @@ -0,0 +1,28 @@ +class: GalaxyWorkflow +inputs: + input_data: + type: data + when: + type: boolean +outputs: + picked: + outputSource: pick/output +steps: + branch: + tool_id: cat + in: + input1: + source: input_data + when: + source: when + when: $(inputs.when) + pick: + type: pick_value + in: + input_0: + source: branch/out_file1 + state: + mode: first_or_skip + out: + output: + change_datatype: txt