common-workflow-language / common-workflow-language/cwltool

Validation: matching types flagged as incompatible for multiple inputs

Open
#929 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

A workflow with single optional array input connecting to node with optional array input passes validation. A workflow with a pair of optional array inputs connecting to same node with `merge_flattened` raises compatibility warnings.

## Expected Behavior
Workflow should pass with no warnings, since the inputs are of matching types.

## Actual Behavior

```
cwltool --validate --non-strict multi-input-flattened.cwl
/Users/kghose/miniconda2/envs/cwl/bin/cwltool 1.0.20180923172926
Resolved 'multi-input-flattened.cwl' to 'file:///Users/kghose/Work/cwltool-bugs/link_merge/multi-input-flattened.cwl'
Workflow checker warning:
multi-input-flattened.cwl:7:5: Source 'in1' of type ["null", {"type": "array", "items": "string"}]
may be incompatible
multi-input-flattened.cwl:18:9: with sink 'array' of type ["null", {"type": "array", "items":
"string"}]
source has linkMerge method merge_flattened
multi-input-flattened.cwl:9:5: Source 'in2' of type ["null", {"type": "array", "items": "string"}]
may be incompatible
multi-input-flattened.cwl:18:9: with sink 'array' of type ["null", {"type": "array", "items":
"string"}]
source has linkMerge method merge_flattened
multi-input-flattened.cwl is valid CWL.
```

## Workflow Code
`app.cwl`:
```
class: CommandLineTool
cwlVersion: v1.0
id: app
baseCommand:
- echo
inputs:
- id: array
type: 'string[]?'
inputBinding:
position: 0
outputs:
- id: output
type: File?
outputBinding:
glob: '*.txt'
label: app
requirements:
- class: DockerRequirement
dockerPull: alpine
stdout: out.txt
```

`multi-input-flattened.cwl`:

```
class: Workflow
cwlVersion: v1.0
id: multi_input_flattened
label: multi-input-flattened
inputs:
- id: in1
type: 'string[]?'
- id: in2
type: 'string[]?'
outputs:
- id: output
outputSource:
- app/output
type: File?
steps:
- id: app
in:
- id: array
linkMerge: merge_flattened
source:
- in1
- in2
out:
- id: output
run: ./app.cwl
label: app
requirements:
- class: MultipleInputFeatureRequirement
```

`single-input.cwl`:
```
class: Workflow
cwlVersion: v1.0
id: single_input
label: single-input
inputs:
- id: in1
type: 'string[]?'
outputs:
- id: output
outputSource:
- app/output
type: File?
steps:
- id: app
in:
- id: array
source: in1
out:
- id: output
run: ./app.cwl
label: app
requirements: []
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.