Skip to content

[25.0] Fix optional unspecified input to conditional step #20647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release_25.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/galaxy/workflow/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def to_cwl(
value, hda_references, step: Optional[WorkflowStep] = None, compute_environment: Optional[ComputeEnvironment] = None
):
element_identifier = None
if isinstance(value, NoReplacement):
value = None
if isinstance(value, model.HistoryDatasetCollectionAssociation):
value = value.collection
if isinstance(value, model.DatasetCollectionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- doc: |
Test optional unspecified input into conditional step works
job:
required_dataset:
type: File
value: 2.tabular
file_type: tabular
outputs:
out:
class: Collection
collection_type: list
elements:
"0":
asserts:
- has_text:
text: "null"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class: GalaxyWorkflow
doc: |
This workflow tests the behavior of optional inputs to a conditional database operation step.
Regression test for https://github.com/galaxyproject/galaxy/issues/20182
inputs:
required_dataset:
type: data
optional_dataset:
type: data
optional: true
when:
type: boolean
default: false
outputs:
out:
outputSource: build_list/output
steps:
build_list:
tool_id: __BUILD_LIST__
in:
datasets_0|input: required_dataset
datasets_1|input: optional_dataset
when:
source: when
when: $(inputs.when)
Loading