# TypeError: import\_table: parameter 'types': expected Mapping\[str, (hail.expr.types.HailType or (str))\], found dict:

**URL:** <https://discuss.hail.is/t/typeerror-import-table-parameter-types-expected-mapping-str-hail-expr-types-hailtype-or-str-found-dict/871>\
**Category:** Hail Query & hailctl\
**Created:** [February 22, 2019, 2:35pm UTC](https://discuss.hail.is/t/typeerror-import-table-parameter-types-expected-mapping-str-hail-expr-types-hailtype-or-str-found-dict/871 "2019-02-22T14:35:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhx037](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/hhx037/32/160_2.png) [@hhx037](https://discuss.hail.is/u/hhx037)\
**Post date:** [February 22, 2019, 2:35pm UTC](https://discuss.hail.is/t/typeerror-import-table-parameter-types-expected-mapping-str-hail-expr-types-hailtype-or-str-found-dict/871/1 "2019-02-22T14:35:25Z")

</div>

Hi,

I’m trying to load a table and impose field type and am following the manual but get an error, as if it was not indeed expecting a dictionary.

https://hail.is/docs/0.2/methods/impex.html?highlight=import\_table#hail.methods.import\_table

`pheno = hl.import_table('/mnt/phenotypes.txt', impute=False, delimiter='\s+', types={'ID_2': str, 'missing' : hl.tint32}).key_by('ID_2')`

> TypeError: import\_table: parameter ‘types’: expected Mapping[str, (hail.expr.types.HailType or (str))], found dict: {‘ID\_2’: \<class ‘str’\>, ‘missing’: dtype(‘int32’)}

Any idea what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [February 22, 2019, 4:37pm UTC](https://discuss.hail.is/t/typeerror-import-table-parameter-types-expected-mapping-str-hail-expr-types-hailtype-or-str-found-dict/871/2 "2019-02-22T16:37:22Z")

</div>

`str` isn’t a hail type - this should be either `hl.tstr` or `'str'`(which will be automatically parsed by `hl.dtype`)

---

<div class="post-metadata">

**Author:** ![hhx037](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/hhx037/32/160_2.png) [@hhx037](https://discuss.hail.is/u/hhx037)\
**Post date:** [February 22, 2019, 5:28pm UTC](https://discuss.hail.is/t/typeerror-import-table-parameter-types-expected-mapping-str-hail-expr-types-hailtype-or-str-found-dict/871/3 "2019-02-22T17:28:11Z")

</div>

Argh… of course, thank you.
