newer parsers choking on secondaryFiles input
leipzig opened this issue · comments
Jeremy Leipzig commented
I might have introduced this bug myself but filing anyway. I am using cwl-utils==0.7
>>> import cwl_utils.parser_v1_0 as parser10
>>> import cwl_utils.parser_v1_1 as parser11
>>> import cwl_utils.parser_v1_2 as parser12
>>> parser10.load_document("https://raw.githubusercontent.com/common-workflow-library/bio-cwl-tools/release/bwa/BWA-Mem.cwl")
<cwl_utils.parser_v1_0.CommandLineTool object at 0x1095b5cc0>
(works)
>>> parser11.load_document("https://raw.githubusercontent.com/common-workflow-library/bio-cwl-tools/release/bwa/BWA-Mem.cwl")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/leipzig/miniconda3/lib/python3.6/site-packages/cwl_utils/parser_v1_1.py", line 12191, in load_document
return _document_load(union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader, doc, baseuri, loadingOptions)
File "/Users/leipzig/miniconda3/lib/python3.6/site-packages/cwl_utils/parser_v1_1.py", line 474, in _document_load
loader, loadingOptions.fetcher.urljoin(baseuri, doc), loadingOptions
File "/Users/leipzig/miniconda3/lib/python3.6/site-packages/cwl_utils/parser_v1_1.py", line 518, in _document_load_by_url
return _document_load(loader, result, url, loadingOptions)
File "/Users/leipzig/miniconda3/lib/python3.6/site-packages/cwl_utils/parser_v1_1.py", line 492, in _document_load
return loader.load(doc, baseuri, loadingOptions, docRoot=baseuri)
File "/Users/leipzig/miniconda3/lib/python3.6/site-packages/cwl_utils/parser_v1_1.py", line 334, in load
raise ValidationException("", None, errors, "-")
schema_salad.exceptions.ValidationException: - tried _RecordLoader but
Trying 'CommandLineTool'
the `inputs` field is not valid because:
- tried _ArrayLoader but
Expected a list
- tried _RecordLoader but
Trying 'CommandInputParameter'
https://raw.githubusercontent.com/common-workflow-library/bio-cwl-tools/release/bwa/BWA-Mem.cwl:22:5: the
`secondaryFiles`
field is not valid
because:
- tried
_PrimitiveLoader but
Expected a type but
got CommentedSeq
- tried
_RecordLoader but
Expected a dict
- tried
_ArrayLoader but
-
tried _ArrayLoader
but
Expected a list
-
tried _RecordLoader
but
Expected a dict
-
tried _ArrayLoader
but
Expected a list
-
tried _RecordLoader
but
Expected a dict
-
tried _ArrayLoader
but
Expected a list
-
tried _RecordLoader
but
Expected a dict
-
tried _ArrayLoader
but
Expected a list
-
tried _RecordLoader
but
Expected a dict
-
tried _ArrayLoader
but
Expected a list
-
tried _RecordLoader
but
Expected a dict
-
tried _ArrayLoader
but
Expected a list
-
tried _RecordLoader
but
Expected a dict
- tried _RecordLoader but
Not a ExpressionTool
- tried _RecordLoader but
Not a Workflow
- tried _ArrayLoader but
Expected a list
(broken)
>>> parser12.load_document("https://raw.githubusercontent.com/common-workflow-library/bio-cwl-tools/release/bwa/BWA-Mem.cwl")
Traceback (most recent call last):
(same error)
Michael R. Crusoe commented
Hey @leipzig , I think this is the same as #31 (comment) as we switched to using secondaryFilesDSL
in the schema for CWL v1.1 and v1.2, but support for that hasn't been added to schema-salad-tool --codegen
yet
Did you try regenerating the CWL v1.1 parser using your branch?
schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.1/blob/main/CommonWorkflowLanguage.yml > cwl_utils/parser_v1_1.py