common-workflow-language / common-workflow-language/cwltool
Bad interpreting of Null
- Vorherrschende Sprache
- Python
- Sterne
- 376
- Forks
- 255
- Ø Merge
- 2 T. 7 Std.
- Gemergte PRs (30 T.)
- 12
Beschreibung
## Expected Behavior
When optional workflow input is not provided, tool that is called as a step should use the default value for this input.
## Actual Behavior
If optional workflow input is not provided, it's set as Null. Tool that is called as a step evaluates Null as some specific value and doesn't use Default
## Workflow Code
```
cwlVersion: v1.0
class: Workflow
inputs:
input_file:
type: File?
outputs: []
steps:
copy:
run: cat.cwl
in:
input_file: input_file
out: []
```
```
cwlVersion: v1.0
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: ubuntu
inputs:
input_file:
type: File?
inputBinding:
position: 1
default: {"class": "File", "path": "./empty.txt"}
outputs: []
baseCommand: cat
```
## Full Traceback
```pytb
cwltool --debug workflow.cwl
/usr/local/bin/cwltool 1.0.20170525215327
Resolved 'workflow.cwl' to 'file:///Users/kot4or/workspaces/cwl_ws/cwl_sandbox/null_default/workflow.cwl'
job.yml:2:3: invalid field `input_file_`, expected one of: 'input_file'
[workflow workflow.cwl] initialized from file:///Users/kot4or/workspaces/cwl_ws/cwl_sandbox/null_default/workflow.cwl
[workflow workflow.cwl] start
[workflow workflow.cwl] starting step copy
[job step copy] job input {
"file:///Users/kot4or/workspaces/cwl_ws/cwl_sandbox/null_default/workflow.cwl#copy/input_file": null
}
[job step copy] evaluated job input to {
"file:///Users/kot4or/workspaces/cwl_ws/cwl_sandbox/null_default/workflow.cwl#copy/input_file": null
}
[step copy] start
[job copy] initializing from file:///Users/kot4or/workspaces/cwl_ws/cwl_sandbox/null_default/cat.cwl as part of step copy
[job copy] {
"input_file": null
}
[job copy] path mappings is {}
[job copy] command line bindings is [
{
"position": [
-1000000,
0
],
"datum": "cat"
},
{
"position": [
1,
"input_file"
],
"datum": null
}
]
[job copy] /var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpfJxa3y$ docker \
run \
-i \
--volume=/private/var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpfJxa3y:/private/var/spool/cwl:rw \
--volume=/private/var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpUertMN:/tmp:rw \
--workdir=/private/var/spool/cwl \
--read-only=true \
--user=501 \
--rm \
--env=TMPDIR=/tmp \
--env=HOME=/private/var/spool/cwl \
ubuntu \
cat
[job copy] completed success
[job copy] {}
[step copy] produced output {}
[step copy] completed success
[workflow workflow.cwl] completed success
[job copy] Removing input staging directory /var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpdUI_hk
[job copy] Removing temporary directory /var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpUertMN
Removing intermediate output directory /var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpfJxa3y
Removing intermediate output directory /var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpWDnjzc
{}
Final process status is success
```
## Your Environment
* cwltool version: 1.0.20170525215327
## Link to reproduce test
https://github.com/michael-kotliar/cwl_sandbox/tree/master/null_default
`cwltool --debug workflow.cwl`
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.