common-workflow-language / common-workflow-language/schema_salad

Optional array of enums crashes when a value is set

Open
#248 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

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'])
```

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.