Skip to content

Commit ff121fd

Browse files
authored
Merge pull request #170 from nextflow-io/fix-yaml-bugs
Fix YAML samplesheet issues
2 parents caee8be + 356680d commit ff121fd

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
1. CSV and TSV files with trailing commas or tabs will now be properly sanitized. This fixes issues with CSV and TSV files that contained empty header columns.
2121
2. Unidentified parameters are no longer printed out on failure of the parameter validation. This is to prevent a bug where all parameters would be printed out on failure.
2222
3. Fixed an issue where default values of `null` weren't being set correctly in `samplesheetToList()`.
23+
4. Fixed an undocumented limit of `3MB` for `YAML` format samplesheets (new limit is `50MB`).
24+
5. Fixed issue where an empty string in a yaml for a file type string format would throw a Java error instead of reporting a proper validation error.
2325

2426
## Logging configuration
2527

src/main/groovy/nextflow/validation/utils/Files.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package nextflow.validation.utils
22

33
import org.yaml.snakeyaml.Yaml
4+
import org.yaml.snakeyaml.LoaderOptions
45
import org.json.JSONArray
56
import org.json.JSONObject
67
import org.json.JSONPointer
@@ -85,7 +86,9 @@ public class Files {
8586
}
8687

8788
if(fileType == "yaml"){
88-
return new Yaml().load((file.text))
89+
def LoaderOptions yamlLoaderOptions = new LoaderOptions()
90+
yamlLoaderOptions.setCodePointLimit(50 * 1024 * 1024)
91+
return new Yaml(yamlLoaderOptions).load((file.text))
8992
}
9093
else if(fileType == "json"){
9194
return new JsonSlurper().parseText(file.text)

src/main/groovy/nextflow/validation/validators/evaluators/ExistsEvaluator.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class ExistsEvaluator implements Evaluator {
3030
}
3131

3232
def String value = node.asString()
33-
def Path file = Nextflow.file(value) as Path
3433
def Boolean exists
34+
def Path file
3535

3636
try {
3737
file = Nextflow.file(value) as Path

0 commit comments

Comments
 (0)