Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

YAML format samplesheets are not properly vaildated #121

Closed
awgymer opened this issue Oct 18, 2023 · 1 comment
Closed

YAML format samplesheets are not properly vaildated #121

awgymer opened this issue Oct 18, 2023 · 1 comment

Comments

@awgymer
Copy link
Collaborator

awgymer commented Oct 18, 2023

Discovered as a side effect of #120

yaml format samplesheets are currently not actually vaildated by the validateFile:

if(fileType == "yaml"){
fileContent = new Yaml().load((samplesheetFile.text))
}
else {
Map types = variableTypes(schemaFile.toString(), baseDir)
fileContent = samplesheetFile.splitCsv(header:true, strip:true, sep:delimiter)
fileContentCasted = castToType(fileContent, types)
}
if (validateFile(false, samplesheetFile.toString(), fileContentCasted, schemaFile.toString(), baseDir, s3PathCheck)) {
log.debug "Validation passed: '$samplesheetFile' with '$schemaFile'"
}

and

if(fileType == "yaml"){
fileContent = new Yaml().load((file_path.text))
}
else {
Map types = variableTypes(schema_name, baseDir)
fileContent = file_path.splitCsv(header:true, strip:true, sep:delimiter)
fileContentCasted = castToType(fileContent, types)
}
if (validateFile(useMonochromeLogs, key, fileContentCasted, schema_name, baseDir, s3PathCheck)) {
log.debug "Validation passed: '$key': '$file_path' with '$schema_name'"
}

This doesn't throw an error but an empty list is passed to validateFile in the yaml case instead of the fileContent.

The fix should be as simple as switching to fileContentCasted = new Yaml().load((samplesheetFile.text)).

@mirpedrol
Copy link
Collaborator

Fixed by #124, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants