Skip to content

Commit f475c5a

Browse files
authored
Merge pull request #20647 from mvdbeek/invocation_optional_db_ops_tool_fix_20182
[25.0] Fix optional unspecified input to conditional step
2 parents 696ba53 + 76823c5 commit f475c5a

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

lib/galaxy/workflow/modules.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def to_cwl(
154154
value, hda_references, step: Optional[WorkflowStep] = None, compute_environment: Optional[ComputeEnvironment] = None
155155
):
156156
element_identifier = None
157+
if isinstance(value, NoReplacement):
158+
value = None
157159
if isinstance(value, model.HistoryDatasetCollectionAssociation):
158160
value = value.collection
159161
if isinstance(value, model.DatasetCollectionElement):
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- doc: |
2+
Test optional unspecified input into conditional step works
3+
job:
4+
required_dataset:
5+
type: File
6+
value: 2.tabular
7+
file_type: tabular
8+
outputs:
9+
out:
10+
class: Collection
11+
collection_type: list
12+
elements:
13+
"0":
14+
asserts:
15+
- has_text:
16+
text: "null"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class: GalaxyWorkflow
2+
doc: |
3+
This workflow tests the behavior of optional inputs to a conditional database operation step.
4+
Regression test for https://github.com/galaxyproject/galaxy/issues/20182
5+
inputs:
6+
required_dataset:
7+
type: data
8+
optional_dataset:
9+
type: data
10+
optional: true
11+
when:
12+
type: boolean
13+
default: false
14+
outputs:
15+
out:
16+
outputSource: build_list/output
17+
steps:
18+
build_list:
19+
tool_id: __BUILD_LIST__
20+
in:
21+
datasets_0|input: required_dataset
22+
datasets_1|input: optional_dataset
23+
when:
24+
source: when
25+
when: $(inputs.when)

0 commit comments

Comments
 (0)