From 77ebeeab26971a1da26d4d3bd98c2f48195af6db Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 11 Mar 2026 00:59:50 -0400 Subject: [PATCH] Fix pick_value all_non_null empty result + parameter default unwrap. - all_non_null mode now produces empty collection when all inputs are null instead of erroring. Matches expected semantics where filtering nulls can yield zero results. - Fix _ensure_input_step_outputs_populated to unwrap {"src": "json", "value": X} parameter defaults, matching InputParameterModule's get_input_value() unwrap logic. Pre-populated values now consistent with what execute() produces. Co-Authored-By: Claude Opus 4.6 --- lib/galaxy/workflow/modules.py | 9 ++------- lib/galaxy/workflow/run.py | 8 +++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index dcbc983ebdb..382ed565c73 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -2085,13 +2085,8 @@ class PickValueModule(WorkflowModule): output = non_null[0] elif mode == "all_non_null": - if not non_null: - raise FailWorkflowEvaluation( - why=InvocationFailureExpressionEvaluationFailed( - reason=FailureReason.expression_evaluation_failed, - workflow_step_id=step.id, - ) - ) + # CWL spec: all_non_null returns list of non-null values, + # which may be empty if all inputs are null. output = self._create_collection_from_list(trans, invocation_step, non_null) else: diff --git a/lib/galaxy/workflow/run.py b/lib/galaxy/workflow/run.py index db0442ec4e0..c38334698e9 100644 --- a/lib/galaxy/workflow/run.py +++ b/lib/galaxy/workflow/run.py @@ -724,7 +724,13 @@ class WorkflowProgress: # Determine output value from inputs_by_step_id or default outputs = {} if step.id not in self.inputs_by_step_id: - outputs["output"] = step.get_input_default_value(NO_REPLACEMENT) + default_value = step.get_input_default_value(NO_REPLACEMENT) + # For parameter_input steps, unwrap {"src": "json", "value": X} + # dicts to just X — matching the unwrap logic in + # InputParameterModule.get_input_value(). + if step.type == "parameter_input" and isinstance(default_value, dict): + default_value = default_value.get("value", default_value) + outputs["output"] = default_value else: outputs["output"] = self.inputs_by_step_id[step.id]