schema_salad icon indicating copy to clipboard operation
schema_salad copied to clipboard

Optional array of enums crashes when a value is set

Open bogdang989 opened this issue 5 years ago • 0 comments

A CWL1.0 tool is defined as:

class: CommandLineTool
cwlVersion: v1.0
id: b
baseCommand:
  - touch
  - blablai
inputs:
  - id: input
    type:
      - "null"
      - type: array
        items:
          type: enum
          name: bla
          symbols:
            - a
            - b
outputs:
  - id: output
    type: File?
    outputBinding:
      glob: blablai

When executed using: cwltool --input a Error is raised by schema.py

  File "/home/python3.7/site-packages/cwltool/builder.py", line 240, in bind_input
    avsc = make_avsc_object(convert_to_dict(t), self.names)
  File "/home/python3.7/site-packages/schema_salad/avro/schema.py", line 561, in make_avsc_object
    return ArraySchema(items, names, other_props)
  File "/home/python3.7/site-packages/schema_salad/avro/schema.py", line 397, in __init__
    'names: %s)' % (items, err, list(names.names.keys())))
schema_salad.avro.schema.SchemaParseException: Items schema ({'type': 'enum', 'name': 'bla', 'symbols': ['a', 'b']}) not a valid Avro schema: The name "bla" is already in use. (known names: ['File', 'File_class', 'Directory', 'Directory_class', 'Any', 'input_record_schema', 'bla', 'outputs_record_schema'])
Workflow error, try again with --debug for more information:
Items schema ({'type': 'enum', 'name': 'bla', 'symbols': ['a', 'b']}) not a valid Avro schema: The name "bla" is already in use. (known names: ['File', 'File_class', 'Directory', 'Directory_class', 'Any', 'input_record_schema', 'bla', 'outputs_record_schema'])

bogdang989 avatar May 22 '19 15:05 bogdang989