Fix PJAs corrupting skipped pick_value outputs

_apply_post_job_actions ran unconditionally, changing the datatype of
skipped HDAs (expression.json) away from expression.json. This broke
downstream skip detection. Guard with _is_null_or_skipped check.

Adds framework test: pick_value_skip_pja verifies skipped output
retains expression.json when ChangeDatatypeAction is configured.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
John Chilton
2026-03-22 19:15:04 -04:00
co-authored by Claude Opus 4.6
parent 700c991072
commit b280e5bca8
3 changed files with 47 additions and 1 deletions
+3 -1
View File
@@ -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:
@@ -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
@@ -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