Nested empty array

Hello! I am trying to instantiate an annotation that will ultimately by an array of dictionaries. I imagined it would go something like this:

ht = ht.annotate(putative_causal=hl.empty_array(hl.empty_dict(hl.tstr, hl.tstr)))

but I am getting the following error:

Traceback (most recent call last):
  File "/tmp/ea1f5846c080472daf03f506c23d6557/test.py", line 6, in <module>
    ht = ht.annotate(test=hl.empty_array(hl.empty_dict(hl.tstr, hl.tstr)))
  File "<decorator-gen-961>", line 2, in empty_array
  File "/opt/conda/default/lib/python3.6/site-packages/hail/typecheck/check.py", line 613, in wrapper
    args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
  File "/opt/conda/default/lib/python3.6/site-packages/hail/typecheck/check.py", line 567, in check_all
    )) from e
TypeError: empty_array: parameter 't': expected (hail.expr.types.HailType or (str)), found hail.expr.expressions.typed_expressions.DictExpression: <DictExpression of type dict<str, str>>

Do I have the syntax wrong, or is it not possible to create an empty array of anything other than singular types (tstr, tint, tfloat etc)?

The argument to empty_array has to be a type rather than a value of a type. You’re looking for hl.tdict(hl.tstr, hl.tstr).

Great, thanks! I figured it was something about the syntax I wasn’t getting.