Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support record type input with dot-notation CLI params#7170

Merged
bentsherman merged 3 commits into
masterfrom
fix-custom-record-types-with-dot-notation-cli
Jun 16, 2026
Merged

Support record type input with dot-notation CLI params#7170
bentsherman merged 3 commits into
masterfrom
fix-custom-record-types-with-dot-notation-cli

Conversation

@jorgee

@jorgee jorgee commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Convert nested Map/ConfigMap values to the declared Record subclass when resolving CLI dot-notation parameters
  • Fixes two related bugs that surface when a params entry or a process input is typed as a custom Record (e.g. Sample) and supplied via dot notation
  • Follow-up to Fix destructured record input in module run #7164, which fixed the same scenario for destructured tuple-record inputs

Problem

Given a module test/records with a typed record input:

nextflow.enable.types = true

record Sample {
    id: String
    greeting: String
}

process RECORDS {
    input:
    sample: Sample

    script:
    """
    echo "$sample.id $sample.greeting"
    """
}

and a workflow module.nf as the following:

nextflow.enable.types = true
include { RECORDS; Sample } from "test/records"

params {
  sample:Sample
}

workflow {

    inputs = channel.of(
        params.sample
    )

    RECORDS(inputs)
}

Running with dot-notation CLI parameters fails:

  1. nextflow run module.nf --sample.id a --sample.greeting hola

    Parameter `sample` with type Sample cannot be assigned to [id:a, greeting:hola] [RecordMap]
    

    The params DSL converts the nested map into a RecordMap (via TypeHelper.asType) but the subsequent assignability check rejects it.

  2. nextflow module run test/records --sample.id a --sample.greeting hola

    WARN: [RECORDS] invalid argument type at index 0 -- expected a Sample but got a ConfigMap
    

    The process entry handler passes the nested ConfigMap straight through without converting it to the declared Record type.

PR #7164 fixed the equivalent case for destructured tuple-record inputs; this PR extends the fix to named record inputs.

Changes

  • ParamsDsl.isAssignableFrom treats RecordMap as assignable to any Record subclass.
  • ProcessEntryHandler.getValueForInputV2 converts a Map value into the declared record type via TypeHelper.asRecordType when the input type is a Record.

Test plan

  • ParamsDslTest — record param resolved from a nested map
  • ProcessEntryHandlerTest — dot-notation params for named record input
  • ProcessEntryHandlerTestConfigMap value for named record input (module run path)
  • Manual: nextflow run module.nf --sample.id a --sample.greeting hola
  • Manual: nextflow module run <module> --sample.id a --sample.greeting hola

@netlify

netlify Bot commented May 22, 2026

Copy link
Copy Markdown

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 55682eb
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6a31742c50bc390009fd2207
😎 Deploy Preview https://deploy-preview-7170--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jorgee jorgee requested a review from bentsherman May 22, 2026 08:09
@bentsherman bentsherman force-pushed the fix-custom-record-types-with-dot-notation-cli branch from 8c68ff5 to fc3e958 Compare June 16, 2026 16:04
@bentsherman

Copy link
Copy Markdown
Member
  • Support record type param with map input
  • Support record type input in module run
  • Update module run input handling to match params block
  • Remove redundant parseComplexParameters() method (already handled by CmdRun)

@bentsherman bentsherman changed the title Fix custom record types from dot-notation CLI parameters Support record type input with dot-notation CLI params Jun 16, 2026
@bentsherman bentsherman merged commit 48bf94f into master Jun 16, 2026
25 checks passed
@bentsherman bentsherman deleted the fix-custom-record-types-with-dot-notation-cli branch June 16, 2026 16:57
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

Successfully merging this pull request may close these issues.

2 participants