Update: July 26, 2019
This section of the forum is now closed; we are working on a new support model for WDL that we will share here shortly. For Cromwell-specific issues, see the Cromwell docs and post questions on Github.

How to generate Array[object] from python stdout using read_objects

bachimerckbachimerck Member
my wdl file:

# defined structs:
struct testa {
String a
String b

struct testb {
String samp
Array[testa] attr

task do_stuff {
command <<<
python << CODE
print('\t'.join(['1', "[{'a':'1','b':'2'},{'a':'3','b':'4'}]"]))

output {
Array[testb] out = read_objects(stdout())

Here is the error, I am getting:

Bad output 'do_stuff.out': AggregatedMessageException: Error(s):
No coercion defined from wom value(s) '"[{'a':'1','b':'2'},{'a':'1','b':'2'}]"' of type 'String' to 'Array[WomCompositeType {
a -> String
b -> String

I am expected output as something like this:
{ "samp": "1",
"attr": [ {"a":"1","b":"2"}, {"a":"3","b":"4"}]
Sign In or Register to comment.