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

Override an optional with null #3819

Open
orodeh opened this issue Jun 26, 2018 · 2 comments
Open

Override an optional with null #3819

orodeh opened this issue Jun 26, 2018 · 2 comments

Comments

@orodeh
Copy link
Collaborator

orodeh commented Jun 26, 2018

This is related (at least) to #2446.

Examine the workflow wf below.

workflow wf {
    String? who

    call hello { input:
        who = who
    }
}

task hello {
    String? who = "world"

    command {
        echo "Hello, ${who}"
    }
    output {
         String result = read_string(stdout())
    }
}

When running wf with Cromwell v32 the result is hello.result = "Hello, world". However, since we are calling the task with an empty value, it should override who, and the the result should be (I think) Hello,".

@aednichols
Copy link
Collaborator

aednichols commented Sep 13, 2018

Thanks for reporting.

I think Cromwell is having trouble because it can't distinguish between

wf specifically set who to null, so don't accept the default in hello

and

wf does not set who, so accept the default in hello

because it's just null either way!

@aednichols
Copy link
Collaborator

With inputs

{
  "wf.input_to_wf": null
}

and WDL

version 1.0

workflow wf {
    input {
        String? input_to_wf = "Neither should this"
    }

    call hello { input:
        input_to_hello = input_to_wf
    }
}

task hello {
    input {
        String? input_to_hello = "This should not be here"
    }

    command {
        echo "Should be blank: ${input_to_hello}"
    }
    output {
         String result = read_string(stdout())
    }
}

the result is

"Should be blank: This should not be here"

...so it would seem that Cromwell understands not to overwrite null with a default value sometimes, just not on calls.

@ruchim ruchim removed this from the CUI - Cromwell as a conformant WDL engine milestone Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants