diff --git a/CHANGELOG.md b/CHANGELOG.md index 95acaf581..4c406142c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,15 @@ TODO add summary ## BUG FIXES * `__merge__`: Handle invalid yaml during merging (PR #570). There was not enough error handling during this operation. Switched to the more advanced `Convert.textToJson` helper method. - + + + + + +## BUG FIXES + +* `NextflowPlatform`: Fix `Invalid method invocation 'call'` error when using `.run()` without `fromState` defined and the input channel holds tuples with more than two elements (PR #587). This issue also impacts some other helper functionality like `runEach()`. + # Viash 0.8.0 (2023-10-23): Nextflow workflows and dependencies Nextflow workflows definitions are picked up by Viash and assembled into a functional Nextflow workflow, reducing the amount of boilerplate code needed to be written by the user. diff --git a/src/main/resources/io/viash/runners/nextflow/workflowFactory/workflowFactory.nf b/src/main/resources/io/viash/runners/nextflow/workflowFactory/workflowFactory.nf index bf981b8f0..18404da87 100644 --- a/src/main/resources/io/viash/runners/nextflow/workflowFactory/workflowFactory.nf +++ b/src/main/resources/io/viash/runners/nextflow/workflowFactory/workflowFactory.nf @@ -120,7 +120,7 @@ def workflowFactory(Map args, Map defaultWfArgs, Map meta) { def new_data = workflowArgs.fromState(it.take(2)) [it[0], new_data] } : - chRun + chRun | map {tup -> tup.take(2)} // fill in defaults chArgsWithDefaults = chArgs diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/main.nf b/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/main.nf index 55e4d38a1..2ba19788d 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/main.nf +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/main.nf @@ -9,10 +9,9 @@ workflow base { file = tempFile() file.write("num: $num") - ["num$num", [ num: num, file: file ]] + ["num$num", [ file: file ], ["num": num]] } | sub_workflow.run( - fromState: ["file": "file"], toState: {id, output, state -> def newState = [ "step1_output": output.output, @@ -22,8 +21,8 @@ workflow base { return newState } ) - | view{ id, state -> - def num = state.num + | view{ id, state, extra -> + def num = extra.num // check id assert id == "num$num": "id should be 'num$num'. Found: '$id'"