Skip to content

checkFormat raises exception for workflow input set by default to Null #409

Closed

Description

@michael-kotliar

Expected Behavior

When optional workflow input input_file with a format field is not provided and the default: null is used the checkFormat function shouldn't raise exception when trying to check format for this input.

Actual Behavior

checkFormat function raises exception for optional workflow input with default: null and format fields.
Workflow doesn't fail if:

  • remove either default: null or format
  • remove namespaces and schemas sections

Workflow Code

cwlVersion: v1.0
class: Workflow

inputs:
  input_file:
    type: File?
    default: null
    format: "http://edamontology.org/format_2572"

outputs: []

steps:
  cat:
    run: cat.cwl
    in:
      input_file: input_file
    out: []

$namespaces:
  s: http://schema.org/
$schemas:
- http://schema.org/docs/schema_org_rdfa.html
s:name: "workflow"
cwlVersion: v1.0
class: CommandLineTool

hints:
  DockerRequirement:
    dockerPull: ubuntu

inputs:
  input_file:
    type:
      - "null"
      - File
    inputBinding:
      position: 1

outputs: []

baseCommand: cat

Full Traceback

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_2/workflow.cwl'
No handlers could be found for logger "rdflib.term"
Parsed job order from command line: {
    "id": "workflow.cwl", 
    "input_file": null
}
Got workflow error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cwltool/main.py", line 243, in single_job_executor
    for r in jobiter:
  File "/usr/local/lib/python2.7/site-packages/cwltool/workflow.py", line 534, in job
    builder = self._init_job(job_order, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cwltool/process.py", line 559, in _init_job
    checkFormat(builder.job[d], builder.do_eval(i["format"]), self.formatgraph)
  File "/usr/local/lib/python2.7/site-packages/cwltool/process.py", line 346, in checkFormat
    if "format" not in af:
TypeError: argument of type 'NoneType' is not iterable
Workflow error, try again with --debug for more information:
argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cwltool/main.py", line 774, in main
    **vars(args))
  File "/usr/local/lib/python2.7/site-packages/cwltool/main.py", line 255, in single_job_executor
    raise WorkflowException(Text(e))
WorkflowException: argument of type 'NoneType' is not iterable

Your Environment

  • cwltool version: 1.0.20170525215327

Link to replicate test

https://github.com/michael-kotliar/cwl_sandbox/tree/master/null_default_2

Activity

  1. added 2 commits that reference this issue on Jun 15, 2017
    1074b1b
    3c8a78c
  2. added a commit that references this issue on Jul 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions