nf-core / nf-core/tools

Schema validation parses string incorrectly if they're quoted integers

Open
#4,367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description of the bug

In my pipeline config I declare a string parameter whose value is numeric (the downstream tool can also accept non-numeric strings):

nstreams = '3'

nf-core pipelines schema build resolves the config value as an integer rather than a string:

✨ Default for 'params.nstreams' in the pipeline config does not match schema. (schema: '<class 'str'>: 3' | config: '<class 'int'>: 3'). Update pipeline schema? [y/n]: y

config: '<class 'int'>: 3' - string is being treated as an integer

Another related thing in the schema:

        "nstreams": {
          "type": "string",
          "default": 3,
          "description": "Number of streams per GPU: applied when gpu_low_memory is false; 'auto' overrides several settings based on GPU and host memory, else INT to set manually"
        },

This also reads as incorrect to me, 3 should be "3", but when I manually correct this and re-run schema build, it reverts.

Command used and terminal output
See above for command and output.
System information

Nextflow version: 25.10.2
Hardware: Desktop
Executor: local
OS: Ubuntu 24.04.4 LTS
Version of nf-core/tools: 4.0.2
Python version: 3.14.2

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the issue with nf-core pipelines schema build using a string parameter set to '3', then trace the schema-build validation and default-value handling. The fix is done when quoted numeric config values remain strings and the generated schema emits the default as a string rather than an integer.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.