Skip to content

Incorrect validation warning when combining "scatter" and "when" #1639

@tetron

Description

@tetron

Expected Behavior

Should not give a warning when scattering with a conditional connects to an array of optional values.

Actual Behavior

It gaves a warning because the output type is computed incorrectly for the order of operations in a step that has both a scatter and a conditional.

Workflow Code

inputs:
  fastq1:
    type: File
  fastq2:
    type: File?

steps:
  fastq-validator:
    run: tools/fastqValidator.cwl
    in:
      file:
        - fastq1
        - fastq2
    out: [std_out]
    scatter: file
    when: $(inputs.file != null)

  adjust-names:
    in:
      fqValidator: fastq-validator/std_out
    out: [fq1, fq2]
    run: adjust-names.cwl
workflow.cwl:21:11: Source 'std_out' of type ["null", {"type": "array", "items": "File"}] may be
                    incompatible
workflow.cwl:28:7:    with sink 'fqValidator' of type {"type": "array", "items": ["null", "File"]}
                      Source is from conditional step and may produce `null`

The checker is using the wrong type for fastq-validator/std_out, it should be {"type": "array", "items": ["null", "File"]}.

Your Environment

cwltool 3.1.20220221215214

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions