Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromwdl: can't handle single character identifiers #92

Open
mr-c opened this issue Aug 30, 2021 · 1 comment
Open

fromwdl: can't handle single character identifiers #92

mr-c opened this issue Aug 30, 2021 · 1 comment

Comments

@mr-c
Copy link
Contributor

mr-c commented Aug 30, 2021

https://github.com/biowdl/tasks/blob/bc1bacf11498d2d30b85591cfccdcf71ef0966a5/bowtie.wdl

Traceback (most recent call last):
  File "/home/michael/src/janis/janis-core/fromwdl.py", line 5, in <module>
    WdlParser.from_doc("/home/michael/wdl2cwl/wdl2cwl/tests/wdl_files/bowtie_1.wdl").translate();
  File "/home/michael/src/janis/janis-core/janis_core/ingestion/fromwdl.py", line 45, in from_doc
    tasks.append(parser.from_loaded_object(t))
  File "/home/michael/src/janis/janis-core/janis_core/ingestion/fromwdl.py", line 51, in from_loaded_object
    return self.from_loaded_task(obj)
  File "/home/michael/src/janis/janis-core/janis_core/ingestion/fromwdl.py", line 243, in from_loaded_task
    inputs=[
  File "/home/michael/src/janis/janis-core/janis_core/ingestion/fromwdl.py", line 244, in <listcomp>
    self.parse_command_tool_input(i)
  File "/home/michael/src/janis/janis-core/janis_core/ingestion/fromwdl.py", line 430, in parse_command_tool_input
    return j.ToolInput(inp.name, self.parse_wdl_type(inp.type), default=default)
  File "/home/michael/src/janis/janis-core/janis_core/tool/commandtool.py", line 140, in __init__
    raise Exception(
Exception: The identifier 'k' was not validated because it was not validated by '[a-zA-Z][a-zA-Z0-9_]+\Z' (must start with letters, and then only contain letters, numbers and an underscore)
@illusional
Copy link
Member

Thanks for exploring and raising this issue @mr-c! I remember we explicitly disallowed single char identifiers, I suspect it was to encourage tool builders to create meaningful inputs, but I can see it's a problem here. The fromcwl parser just has a while loop to make you pick a new identifier.

We could implement something like that here, but it's a bit of effort, I'll leave this issue open for now with the intent to more gracefully handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants