sanitizeOutput() drops all outputs of a process with only unnamed outputs

Open Beginner friendly
#108 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing

Research direction

Start by locating sanitizeOutput() and the tests covering output channel maps; the issue does not name their file paths. Reproduce the example with multiple unnamed outputs, then check the mixed named and unnamed case. Done means both unnamed outputs remain in the sanitized snapshot, including when named outputs are present, and the snapshot no longer matches an empty map.

Written by the indexing model from the issue text.

Description

sanitizeOutput() skips numeric channel keys whenever the channel map has more than one entry, assuming they duplicate named outputs. A process with several unnamed outputs only has numeric keys, so everything is dropped and the snapshot is an empty map that always matches.

process UNNAMED {
    output:
    path "a.txt"
    path "b.txt"

    script:
    """
    echo a > a.txt
    echo b > b.txt
    """
}
println process.out                  // [0:[.../a.txt], 1:[.../b.txt]]
println sanitizeOutput(process.out)  // [:]

The same check also drops an unnamed output that sits next to named ones.

Reproduced on main (1.3.0) with Nextflow 26.10.0 and nf-test 0.9.5.

Possible fix: skip a numeric key only when its value is also emitted under a name, or skip numeric keys only when at least one named key exists.

🤖 Generated with Claude Code

Dominant language
Java
Stars
13
Forks
11
Avg merge
3d 4h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nf-core/nft-utils

All issues in nf-core/nft-utils

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.