# KeyTable.from\_dataframe error

**URL:** <https://discuss.hail.is/t/keytable-from-dataframe-error/563>\
**Category:** Help \[0.1\]\
**Created:** [July 11, 2018, 2:46pm UTC](https://discuss.hail.is/t/keytable-from-dataframe-error/563 "2018-07-11T14:46:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trptyrphe](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/trptyrphe/32/263_2.png) [@trptyrphe](https://discuss.hail.is/u/trptyrphe)\
**Post date:** [July 11, 2018, 2:46pm UTC](https://discuss.hail.is/t/keytable-from-dataframe-error/563/1 "2018-07-11T14:46:07Z")

</div>

Hi, I was trying to incorporate an annotation table which is pyspark data frame:

annotation = KeyTable.from\_dataframe(mytable,‘SampleID’)

got the error I don’t quite understand:  
FatalError: MatchError: TimestampType (of class org.apache.spark.sql.types.TimestampType$)

---

<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:** [July 11, 2018, 2:58pm UTC](https://discuss.hail.is/t/keytable-from-dataframe-error/563/2 "2018-07-11T14:58:36Z")

</div>

Not all PySpark types are valid Hail types. You’ll need to make this DataFrame type a string first, I think.

This is also a bad error message, which is something we’ll want to fix in 0.2, but we’re not pushing patches like that to 0.1 anymore.
