# Nested empty array

**URL:** <https://discuss.hail.is/t/nested-empty-array/1667>\
**Category:** Hail Query & hailctl\
**Created:** [September 18, 2020, 7:02am UTC](https://discuss.hail.is/t/nested-empty-array/1667 "2020-09-18T07:02:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lea-urpa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/lea-urpa/32/474_2.png) [@lea-urpa](https://discuss.hail.is/u/lea-urpa)\
**Post date:** [September 18, 2020, 7:02am UTC](https://discuss.hail.is/t/nested-empty-array/1667/1 "2020-09-18T07:02:35Z")

</div>

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

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

```

but I am getting the following error:

```auto
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)?

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [September 18, 2020, 1:47pm UTC](https://discuss.hail.is/t/nested-empty-array/1667/2 "2020-09-18T13:47:58Z")

</div>

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)`.

---

<div class="post-metadata">

**Author:** ![lea-urpa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/lea-urpa/32/474_2.png) [@lea-urpa](https://discuss.hail.is/u/lea-urpa)\
**Post date:** [September 21, 2020, 10:23am UTC](https://discuss.hail.is/t/nested-empty-array/1667/3 "2020-09-21T10:23:01Z")

</div>

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