You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run into a potential issue when using a struct that contains optional fields.
For example, consider this WDL document.
version 1.1
struct ReadGroup {
String ID
String? BC
String? CN
String? DS
String? DT
String? FO
String? KS
String? LB
String? PG
Int? PI
String? PL
String? PM
String? PU
String? SM
}
task test_task {
input {
ReadGroup read_group
}
command <<<
if [ -z "~{read_group.KS}" ]
then
echo "KS is empty"
fi
>>>
}
I have a struct that represents a SAM read group. When I run miniwdl check, there are no issues reported. However, if I then run miniwdl, with the following input json:
{
"read_group": {
"ID": "test"
}
}
I get an error (Token('CNAME', 'KS')) at ~{read_group.KS}. I have tried alternative methods such as ~{if defined(read_group.KS) then read_group.KS else ""} and ~{select_first([read_group.KS, ""])} which both have the same issue.
Based on the error and the fact that it only occurs at runtime, is it possible that the KS field is not being created on the internal data structure so miniwdl doesn't recognize that token? I would expect that it would exist and simply be undefined similar to other optional variables, but that doesn't seem to be the case.
The text was updated successfully, but these errors were encountered:
Populate optional fields with None values when the input JSON omits them. This was done for `read_json()`, but not the case where the struct is read from a runner input JSON file.
#686
I have run into a potential issue when using a
struct
that contains optional fields.For example, consider this WDL document.
I have a struct that represents a SAM read group. When I run
miniwdl check
, there are no issues reported. However, if I then runminiwdl
, with the following input json:I get an error (
Token('CNAME', 'KS')
) at~{read_group.KS}
. I have tried alternative methods such as~{if defined(read_group.KS) then read_group.KS else ""}
and~{select_first([read_group.KS, ""])}
which both have the same issue.Based on the error and the fact that it only occurs at runtime, is it possible that the
KS
field is not being created on the internal data structure sominiwdl
doesn't recognize that token? I would expect that it would exist and simply beundefined
similar to other optional variables, but that doesn't seem to be the case.The text was updated successfully, but these errors were encountered: