common-workflow-language / common-workflow-language/cwltool
Incorrect validation error with scattered nested workflow and pickValue
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
## Expected Behavior
Nested workflow output type is `string`
Nested workflow is scattered
Main workflow output type is `string`
Main workflow output `pickValue` is set to `first_non_null`
This should be valid
## Actual Behavior
Running `cwltool --validate` throws a validation error which is incorrect. It seems like the `pickValue` field is ignored in validation.
## Workflow Code
```
---
class: Workflow
cwlVersion: v1.2
id: example
label: main_out_str
"$namespaces":
sbg: https://sevenbridges.com
inputs:
- id: input
type: File[]?
sbg:x: -233.0658416748047
sbg:y: -266.9961853027344
outputs:
- id: output
outputSource:
- nested_wf_out_str_array/output
type: string?
sbg:x: 381.93414306640625
sbg:y: -214.9961700439453
pickValue: first_non_null
steps:
- id: nested_wf_out_str_array
in:
- id: input
source: input
out:
- id: output
run:
class: Workflow
cwlVersion: v1.2
id: bogdang/cwl1-2/nested-wf-out-str-array/3
label: nested_wf_out_str_array
"$namespaces":
sbg: https://sevenbridges.com
inputs:
- id: input
type: File?
sbg:x: -202.0658416748047
sbg:y: -237.9961700439453
outputs:
- id: output
outputSource:
- out_str/output
type: string?
sbg:x: 346.93414306640625
sbg:y: -170.9961700439453
steps:
- id: out_str
in:
- id: input
source: input
out:
- id: output
run:
class: CommandLineTool
cwlVersion: v1.2
"$namespaces":
sbg: https://sevenbridges.com
id: bogdang/cwl1-2/out-str/1
baseCommand: []
inputs:
- id: input
type: File?
inputBinding:
shellQuote: false
position: 0
outputs:
- id: output
type: string?
label: out_str
requirements:
- class: ShellCommandRequirement
label: out_str
requirements:
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement
label: nested_wf_out_str_array
scatter:
- input
requirements:
- class: SubworkflowFeatureRequirement
- class: ScatterFeatureRequirement
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement
```
## Full Traceback
```pytb
ERROR Tool definition failed validation:
a.cwl:39:17: Source 'output' of type {"type": "array", "items": ["null", "string"]} is incompatible
a.cwl:23:13: with sink 'output' of type ["null", "string"]
a.cwl:18:9: pickValue is: first_non_null
Traceback (most recent call last):
File "/Users/bogdangavrilovic/opt/miniconda3/lib/python3.8/site-packages/cwltool/main.py", line 1072, in main
tool = make_tool(uri, loadingContext)
File "/Users/bogdangavrilovic/opt/miniconda3/lib/python3.8/site-packages/cwltool/load_tool.py", line 460, in make_tool
tool = loadingContext.construct_tool_object(processobj, loadingContext)
File "/Users/bogdangavrilovic/opt/miniconda3/lib/python3.8/site-packages/cwltool/workflow.py", line 51, in default_make_tool
return Workflow(toolpath_object, loadingContext)
File "/Users/bogdangavrilovic/opt/miniconda3/lib/python3.8/site-packages/cwltool/workflow.py", line 135, in __init__
static_checker(
File "/Users/bogdangavrilovic/opt/miniconda3/lib/python3.8/site-packages/cwltool/checker.py", line 331, in static_checker
raise ValidationException(all_exception_msg)
schema_salad.exceptions.ValidationException:
a.cwl:39:17: Source 'output' of type {"type": "array", "items": ["null", "string"]} is incompatible
a.cwl:23:13: with sink 'output' of type ["null", "string"]
a.cwl:18:9: pickValue is: first_non_null
```
## Your Environment
* cwltool version:
3.1.20210921111717
Contributor guide
Assessment
This issue has not been assessed yet.