Commit 206cc01
Fix groupTuple operator to handle GString vs String keys consistently (#6400)
The groupTuple operator was not properly grouping items when the same
logical key was represented as both GString and String objects. This
occurred when channel values contained interpolated strings (GString)
that were later mixed with regular String literals having the same
content.
The root cause was that GString and String objects with identical
content have different hash codes and equality behavior, causing them
to be treated as separate grouping keys.
This commit adds key normalization in the groupTuple operator that
converts GString objects to String while preserving all other data
types unchanged.
Changes:
- Add normalizeKey() method to convert GString elements to String
- Modify collect() method to normalize keys before grouping
- Add comprehensive unit tests covering GString/String scenarios
- Preserve existing behavior for all non-GString key types
Fixes #6399
🤖 Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5bc9162 commit 206cc01
2 files changed
Lines changed: 57 additions & 2 deletions
File tree
- modules/nextflow/src
- main/groovy/nextflow/extension
- test/groovy/nextflow/extension
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
257 | 274 | | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
143 | 181 | | |
0 commit comments