File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
modules/nextflow/src/main/groovy/nextflow/extension Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ class DataflowHelper {
360
360
if ( ! (entry instanceof List ) ) {
361
361
if ( pivot != [0 ] )
362
362
throw new IllegalArgumentException (" Not a valid `by` index: $pivot " )
363
- result. keys = [ entry]
363
+ result. addKey( entry)
364
364
result. values = []
365
365
return result
366
366
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package nextflow.extension
19
19
import groovy.transform.CompileStatic
20
20
import groovy.transform.EqualsAndHashCode
21
21
import groovy.transform.ToString
22
+ import nextflow.extension.GroupKey
22
23
23
24
/**
24
25
* Implements an helper key-value helper object used in dataflow operators
@@ -33,6 +34,9 @@ class KeyPair {
33
34
List values
34
35
35
36
void addKey (el ) {
37
+ if (keys == null ) {
38
+ keys = []
39
+ }
36
40
keys. add(safeStr(el))
37
41
}
38
42
@@ -41,6 +45,10 @@ class KeyPair {
41
45
}
42
46
43
47
static private safeStr (key ) {
44
- key instanceof GString ? key. toString() : key
48
+ if (key instanceof GString )
49
+ return key. toString()
50
+ if (key instanceof GroupKey )
51
+ return key. getGroupTarget()
52
+ return key
45
53
}
46
54
}
You can’t perform that action at this time.
0 commit comments