Repository navigation
Cast the command line values of nested parameters - #234
Merged
pinin4fjords merged 3 commits intoOct 5, 2026
Merged
Conversation
The cast only looked for the keys of the top-level command line parameters, so the value of a nested parameter (--group.flag true) stayed a String and failed validation against a boolean or number. The nested values of the command line parameters are now followed to find the values to cast. Fixes nextflow-io#233 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 2, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… params Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
Thanks @nvnieuwk ! |
pinin4fjords
added a commit
to pinin4fjords/nf-schema
that referenced
this pull request
Oct 5, 2026
Upstream casts the command line values in a pass before the JSON generator (nextflow-io#234), so the dataflow params are replaced in a pass just before it rather than in the Map converter. A dataflow param given on the command line is then cast like any other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #233
Use case
Nested parameters are how a pipeline that includes another pipeline (nextflow-io/nextflow#7213, ADR) passes the parameters of the included one, for example
--rnaseq.skip_qc true. The same applies to any nested parameter given on the command line.What changes
The String values given on the command line are cast to the type they have (
trueto a boolean,3to an integer, and so on) before validation. A value is cast when it is found insession.cliParamsat the same place as in the params: the nested values of a nested parameter are found in the nested maps ofsession.cliParams(--group.flag trueis[group: [flag: 'true']]). Values that were not given on the command line are not cast.The cast is the new
Types.castCliValues(), applied to the params before they are converted to JSON. It takes the place of theMapconverter, which compared the keys of every nested map with the top-level keys ofsession.cliParams, so a nested value was never cast, and a nested key with the same name as a top-level command line parameter was.Tests
TypesTest: boolean, integer, float and String values, values not given on the command line, nested values at several levels, and a nested key with the name of a top-level parameterValidateCliParamsTest(with a mockedSession): a nested value given on the command line is cast and accepted, one that is not of the type is rejected, and a nested String that was not given on the command line is not castAlso checked end to end with a plugin built from this branch on a Nextflow master build, with the reproducer in #233:
--group.flag trueand--group.count 3pass, and--group.flag maybeand--group.count abcare reported.Related
#230 (Channel and Value params) is an independent fix for the same kind of pipeline. Its CHANGELOG entry is in the same section, and it edits the same part of
ParameterValidator.groovy(theMapconverter that casts the command line values), so the second of the two to merge needs a rebase.