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

Bug report: write_map omits line ending for the last key-value pair #7021

Closed
SHuang-Broad opened this issue Feb 28, 2023 · 3 comments
Closed

Comments

@SHuang-Broad
Copy link
Contributor

Like reported in the title, write_map will write a TSV without a line ending \n for the last pair.

Minimal example
This will yield 1, as opposed to the expected 2.

workflow TestWriteMap {
    call WriteAMap {
        input: input_map = {'A': 1, 'B': 2}
    }
    output {
        Int tsv_len = WriteAMap.tsv_len
    }
}

task WriteAMap {
    input {
        Map [String, String] input_map
    }
    command <<<
        set -eux

        two_col_tsv=~{write_map(input_map)}
        wc -l "${two_col_tsv}" | awk '{print $1}' > "map_tsv_len.txt"
    >>>
    output {
        Int tsv_len = read_int("map_tsv_len.txt")
    }
    runtime {docker: "gcr.io/cloud-marketplace/google/ubuntu2004:latest"}
}
@SHuang-Broad
Copy link
Contributor Author

Sorry that I forgot to include Cromwell versions.
I've tested on a local Cromwell server, version 63, and on Terra. Both give the same behavior.

@SHuang-Broad
Copy link
Contributor Author

closed by #7022

@cjllanwarne
Copy link
Contributor

Closed by #7022

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