# Error with mt.s.show()

**URL:** <https://discuss.hail.is/t/error-with-mt-s-show/768>\
**Category:** Hail Query & hailctl\
**Created:** [November 13, 2018, 9:07pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768 "2018-11-13T21:07:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 13, 2018, 9:07pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/1 "2018-11-13T21:07:00Z")

</div>

Hi Tim,

I got this error when I tried to run mt.s.show(5) :

FatalError Traceback (most recent call last)  
 in ()  
----\> 1 mt.s.show(5)

in show(self, n, width, truncate, types, handler)

/home/hail/hail.zip/hail/typecheck/check.py in wrapper(\_\_original\_func, \*args, \*\*kwargs)  
558 def wrapper(_original\_func, \*args, \*\*kwargs):  
559 args, kwargs_ = check\_all(\_\_original\_func, args, kwargs, checkers, is\_method=is\_method)  
–\> 560 return _original\_func(\*args, \*\*kwargs_)  
561  
562 return wrapper

/home/hail/hail.zip/hail/expr/expressions/base\_expression.py in show(self, n, width, truncate, types, handler)  
686 Print an extra header line with the type of each field.  
687 “”"  
–\> 688 handler(self.\_show(n, width, truncate, types))  
689  
690 def \_show(self, n=10, width=90, truncate=None, types=True):

/home/hail/hail.zip/hail/expr/expressions/base\_expression.py in \_show(self, n, width, truncate, types)  
709 if source is not None:  
710 name = source.\_fields\_inverse.get(self, name)  
–\> 711 t = self.\_to\_table(name)  
712 if name in t.key:  
713 t = t.key\_by(name).select()

/home/hail/hail.zip/hail/expr/expressions/base\_expression.py in \_to\_table(self, name)  
627 else:  
628 m = source.select\_cols(field\_name)  
–\> 629 m = m.rename({field\_name: name})  
630 else:  
631 m = source.select\_cols(\*\*{name: self})

in rename(self, fields)

/home/hail/hail.zip/hail/typecheck/check.py in wrapper(\_\_original\_func, \*args, \*\*kwargs)  
558 def wrapper(_original\_func, \*args, \*\*kwargs):  
559 args, kwargs_ = check\_all(\_\_original\_func, args, kwargs, checkers, is\_method=is\_method)  
–\> 560 return _original\_func(\*args, \*\*kwargs_)  
561  
562 return wrapper

/home/hail/hail.zip/hail/matrixtable.py in rename(self, fields)  
3240 global\_map[k] = v  
3241  
-\> 3242 return MatrixTable(self.\_jvds.renameFields(row\_map, col\_map, entry\_map, global\_map))  
3243  
3244 def distinct\_by\_row(self):

/usr/lib/spark/python/lib/py4j-0.10.4-src.zip/py4j/java\_gateway.py in **call** (self, \*args)  
1131 answer = self.gateway\_client.send\_command(command)  
1132 return\_value = get\_return\_value(  
-\> 1133 answer, self.gateway\_client, self.target\_id, self.name)  
1134  
1135 for temp\_arg in temp\_args:

/home/hail/hail.zip/hail/utils/java.py in deco(\*args, \*\*kwargs)  
208 raise FatalError(’%s\n\nJava stack trace:\n%s\n’  
209 ‘Hail version: %s\n’  
–\> 210 ‘Error summary: %s’ % (deepest, full, hail. **version** , deepest)) from None  
211 except pyspark.sql.utils.CapturedException as e:  
212 raise FatalError(’%s\n\nJava stack trace:\n%s\n’

FatalError: AssertionError: assertion failed

Java stack trace:  
java.lang.AssertionError: assertion failed  
at scala.Predef$.assert(Predef.scala:156)  
at is.hail.variant.MatrixTable.value$lzycompute(MatrixTable.scala:418)  
at is.hail.variant.MatrixTable.value(MatrixTable.scala:415)  
at is.hail.variant.MatrixTable.x$9$lzycompute(MatrixTable.scala:422)  
at is.hail.variant.MatrixTable.x$9(MatrixTable.scala:422)  
at is.hail.variant.MatrixTable.rvd$lzycompute(MatrixTable.scala:422)  
at is.hail.variant.MatrixTable.rvd(MatrixTable.scala:422)  
at is.hail.variant.MatrixTable.renameFields(MatrixTable.scala:968)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)  
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)  
at py4j.Gateway.invoke(Gateway.java:280)  
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)  
at py4j.commands.CallCommand.execute(CallCommand.java:79)  
at py4j.GatewayConnection.run(GatewayConnection.java:214)  
at java.lang.Thread.run(Thread.java:748)

Hail version: 0.2-29fbaeaf265e  
Error summary: AssertionError: assertion failed

Do you have any idea, please?

Best,

Laura

---

<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:** [November 13, 2018, 9:25pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/2 "2018-11-13T21:25:49Z")

</div>

Hi Laura,  
could you try updating to the latest version first? It’s quite possible we’ve fixed this in the last 2 weeks.

Sorry for the trouble.

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 14, 2018, 5:00pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/3 "2018-11-14T17:00:06Z")

</div>

Hi Tim,

I updated Hail with the last version: version 0.2-6866448d481e  
I still have an error:

FatalError Traceback (most recent call last)  
 in ()  
----\> 1 mt.s.show(5)

in show(self, n, width, truncate, types, handler)

/home/hail/hail.zip/hail/typecheck/check.py in wrapper(\_\_original\_func, \*args, \*\*kwargs)  
558 def wrapper(_original\_func, \*args, \*\*kwargs):  
559 args, kwargs_ = check\_all(\_\_original\_func, args, kwargs, checkers, is\_method=is\_method)  
–\> 560 return _original\_func(\*args, \*\*kwargs_)  
561  
562 return wrapper

/home/hail/hail.zip/hail/expr/expressions/base\_expression.py in show(self, n, width, truncate, types, handler)  
686 Print an extra header line with the type of each field.  
687 “”"  
–\> 688 handler(self.\_show(n, width, truncate, types))  
689  
690 def \_show(self, n=10, width=90, truncate=None, types=True):

/home/hail/hail.zip/hail/expr/expressions/base\_expression.py in \_show(self, n, width, truncate, types)  
709 if source is not None:  
710 name = source.\_fields\_inverse.get(self, name)  
–\> 711 t = self.\_to\_table(name)  
712 if name in t.key:  
713 t = t.key\_by(name).select()

/home/hail/hail.zip/hail/expr/expressions/base\_expression.py in \_to\_table(self, name)  
627 else:  
628 m = source.select\_cols(field\_name)  
–\> 629 m = m.rename({field\_name: name})  
630 else:  
631 m = source.select\_cols(\*\*{name: self})

in rename(self, fields)

/home/hail/hail.zip/hail/typecheck/check.py in wrapper(\_\_original\_func, \*args, \*\*kwargs)  
558 def wrapper(_original\_func, \*args, \*\*kwargs):  
559 args, kwargs_ = check\_all(\_\_original\_func, args, kwargs, checkers, is\_method=is\_method)  
–\> 560 return _original\_func(\*args, \*\*kwargs_)  
561  
562 return wrapper

/home/hail/hail.zip/hail/matrixtable.py in rename(self, fields)  
3240 global\_map[k] = v  
3241  
-\> 3242 return MatrixTable(self.\_jvds.renameFields(row\_map, col\_map, entry\_map, global\_map))  
3243  
3244 def distinct\_by\_row(self):

/usr/lib/spark/python/lib/py4j-0.10.4-src.zip/py4j/java\_gateway.py in **call** (self, \*args)  
1131 answer = self.gateway\_client.send\_command(command)  
1132 return\_value = get\_return\_value(  
-\> 1133 answer, self.gateway\_client, self.target\_id, self.name)  
1134  
1135 for temp\_arg in temp\_args:

/home/hail/hail.zip/hail/utils/java.py in deco(\*args, \*\*kwargs)  
208 raise FatalError(’%s\n\nJava stack trace:\n%s\n’  
209 ‘Hail version: %s\n’  
–\> 210 ‘Error summary: %s’ % (deepest, full, hail. **version** , deepest)) from None  
211 except pyspark.sql.utils.CapturedException as e:  
212 raise FatalError(’%s\n\nJava stack trace:\n%s\n’

FatalError: AssertionError: assertion failed: Table{global:Struct{\_\_cols:Array[Struct{s:String}]},key:[locus,alleles],row:Struct{locus:Locus(GRCh37),alleles:Array[String],rsid:String,qual:Float64,filters:Set[String],info:Struct{AC:Array[Int32],AF:Array[Float64],AN:Int32,DP:Int32,AVGDP:Float64,GC:Array[Int32],GN:Int32,HWEAF:Array[Float64],HWDGF:Array[Float64],IBC:Float64,HWE\_SLP:Float64,ABE:Float64,ABZ:Float64,NS\_NREF:Int32,BQZ:Float64,CYZ:Float64,STZ:Float64,NMZ:Float64,IOR:Float64,NM0:Float64,NM1:Float64,SVM:Float64,OVERLAP:Array[String],ANN:Array[String],LOF:Array[String],NMD:Array[String],IS\_HWE\_SLP:Float64,IS\_IBC:Float64},`the entries! [877f12a8827e18f61222c6c8c5fb04a8]`:Array[Struct{GT:Call,DP:Int32,PL:Array[+Int32],GQ:Int32,AD:Array[+Int32]}]}}  
Table{global:+Struct{\_\_cols:Array[Struct{s:String}]},key:[locus,alleles],row:Struct{locus:Locus(GRCh37),alleles:Array[String],rsid:String,qual:Float64,filters:Set[String],info:Struct{AC:Array[Int32],AF:Array[Float64],AN:Int32,DP:Int32,AVGDP:Float64,GC:Array[Int32],GN:Int32,HWEAF:Array[Float64],HWDGF:Array[Float64],IBC:Float64,HWE\_SLP:Float64,ABE:Float64,ABZ:Float64,NS\_NREF:Int32,BQZ:Float64,CYZ:Float64,STZ:Float64,NMZ:Float64,IOR:Float64,NM0:Float64,NM1:Float64,SVM:Float64,OVERLAP:Array[String],ANN:Array[String],LOF:Array[String],NMD:Array[String],IS\_HWE\_SLP:Float64,IS\_IBC:Float64},`the entries! [877f12a8827e18f61222c6c8c5fb04a8]`:Array[Struct{GT:Call,DP:Int32,PL:Array[+Int32],GQ:Int32,AD:Array[+Int32]}]}}

Java stack trace:  
java.lang.AssertionError: assertion failed: Table{global:Struct{\_\_cols:Array[Struct{s:String}]},key:[locus,alleles],row:Struct{locus:Locus(GRCh37),alleles:Array[String],rsid:String,qual:Float64,filters:Set[String],info:Struct{AC:Array[Int32],AF:Array[Float64],AN:Int32,DP:Int32,AVGDP:Float64,GC:Array[Int32],GN:Int32,HWEAF:Array[Float64],HWDGF:Array[Float64],IBC:Float64,HWE\_SLP:Float64,ABE:Float64,ABZ:Float64,NS\_NREF:Int32,BQZ:Float64,CYZ:Float64,STZ:Float64,NMZ:Float64,IOR:Float64,NM0:Float64,NM1:Float64,SVM:Float64,OVERLAP:Array[String],ANN:Array[String],LOF:Array[String],NMD:Array[String],IS\_HWE\_SLP:Float64,IS\_IBC:Float64},`the entries! [877f12a8827e18f61222c6c8c5fb04a8]`:Array[Struct{GT:Call,DP:Int32,PL:Array[+Int32],GQ:Int32,AD:Array[+Int32]}]}}  
Table{global:+Struct{\_\_cols:Array[Struct{s:String}]},key:[locus,alleles],row:Struct{locus:Locus(GRCh37),alleles:Array[String],rsid:String,qual:Float64,filters:Set[String],info:Struct{AC:Array[Int32],AF:Array[Float64],AN:Int32,DP:Int32,AVGDP:Float64,GC:Array[Int32],GN:Int32,HWEAF:Array[Float64],HWDGF:Array[Float64],IBC:Float64,HWE\_SLP:Float64,ABE:Float64,ABZ:Float64,NS\_NREF:Int32,BQZ:Float64,CYZ:Float64,STZ:Float64,NMZ:Float64,IOR:Float64,NM0:Float64,NM1:Float64,SVM:Float64,OVERLAP:Array[String],ANN:Array[String],LOF:Array[String],NMD:Array[String],IS\_HWE\_SLP:Float64,IS\_IBC:Float64},`the entries! [877f12a8827e18f61222c6c8c5fb04a8]`:Array[Struct{GT:Call,DP:Int32,PL:Array[+Int32],GQ:Int32,AD:Array[+Int32]}]}}  
at scala.Predef$.assert(Predef.scala:170)  
at is.hail.expr.ir.LowerMatrixIR$.is$hail$expr$ir$LowerMatrixIR$$lower(LowerMatrixIR.scala:42)  
at is.hail.expr.ir.LowerMatrixIR$$anonfun$matrixRules$1.applyOrElse(LowerMatrixIR.scala:129)  
at is.hail.expr.ir.LowerMatrixIR$$anonfun$matrixRules$1.applyOrElse(LowerMatrixIR.scala:91)  
at is.hail.expr.ir.LowerMatrixIR$.is$hail$expr$ir$LowerMatrixIR$$lower(LowerMatrixIR.scala:40)  
at is.hail.expr.ir.LowerMatrixIR$.apply(LowerMatrixIR.scala:16)  
at is.hail.expr.ir.Interpret$.apply(Interpret.scala:68)  
at is.hail.variant.MatrixTable.x$9$lzycompute(MatrixTable.scala:419)  
at is.hail.variant.MatrixTable.x$9(MatrixTable.scala:419)  
at is.hail.variant.MatrixTable.rvd$lzycompute(MatrixTable.scala:419)  
at is.hail.variant.MatrixTable.rvd(MatrixTable.scala:419)  
at is.hail.variant.MatrixTable.renameFields(MatrixTable.scala:965)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)  
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)  
at py4j.Gateway.invoke(Gateway.java:280)  
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)  
at py4j.commands.CallCommand.execute(CallCommand.java:79)  
at py4j.GatewayConnection.run(GatewayConnection.java:214)  
at java.lang.Thread.run(Thread.java:748)

Hail version: 0.2-6866448d481e  
Error summary: AssertionError: assertion failed: Table{global:Struct{\_\_cols:Array[Struct{s:String}]},key:[locus,alleles],row:Struct{locus:Locus(GRCh37),alleles:Array[String],rsid:String,qual:Float64,filters:Set[String],info:Struct{AC:Array[Int32],AF:Array[Float64],AN:Int32,DP:Int32,AVGDP:Float64,GC:Array[Int32],GN:Int32,HWEAF:Array[Float64],HWDGF:Array[Float64],IBC:Float64,HWE\_SLP:Float64,ABE:Float64,ABZ:Float64,NS\_NREF:Int32,BQZ:Float64,CYZ:Float64,STZ:Float64,NMZ:Float64,IOR:Float64,NM0:Float64,NM1:Float64,SVM:Float64,OVERLAP:Array[String],ANN:Array[String],LOF:Array[String],NMD:Array[String],IS\_HWE\_SLP:Float64,IS\_IBC:Float64},`the entries! [877f12a8827e18f61222c6c8c5fb04a8]`:Array[Struct{GT:Call,DP:Int32,PL:Array[+Int32],GQ:Int32,AD:Array[+Int32]}]}}  
Table{global:+Struct{\_\_cols:Array[Struct{s:String}]},key:[locus,alleles],row:Struct{locus:Locus(GRCh37),alleles:Array[String],rsid:String,qual:Float64,filters:Set[String],info:Struct{AC:Array[Int32],AF:Array[Float64],AN:Int32,DP:Int32,AVGDP:Float64,GC:Array[Int32],GN:Int32,HWEAF:Array[Float64],HWDGF:Array[Float64],IBC:Float64,HWE\_SLP:Float64,ABE:Float64,ABZ:Float64,NS\_NREF:Int32,BQZ:Float64,CYZ:Float64,STZ:Float64,NMZ:Float64,IOR:Float64,NM0:Float64,NM1:Float64,SVM:Float64,OVERLAP:Array[String],ANN:Array[String],LOF:Array[String],NMD:Array[String],IS\_HWE\_SLP:Float64,IS\_IBC:Float64},`the entries! [877f12a8827e18f61222c6c8c5fb04a8]`:Array[Struct{GT:Call,DP:Int32,PL:Array[+Int32],GQ:Int32,AD:Array[+Int32]}]}}

I have other errors with mt.count(), hl.summarize\_variants(mt).

Best,

Laura

---

<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:** [November 14, 2018, 5:16pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/4 "2018-11-14T17:16:41Z")

</div>

Thanks for updating!

Ah… I think I see the problem. Was this table written a while ago (~6 months)? We had an issue where we wrote files with an unintended property for a few weeks, then fixed the problem. However, these files cause trouble with some newer infrastructure.

Could you try putting `.select_globals()` right after your `hl.read_matrix_table` and see if downstream things work after that? If so, I’ll give you a way to edit the file to fix the problem permanently.

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 14, 2018, 6:21pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/5 "2018-11-14T18:21:20Z")

</div>

I still have the same error.  
Do we have to write a new mt file?

---

<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:** [November 14, 2018, 6:26pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/6 "2018-11-14T18:26:14Z")

</div>

to clarify you have:

```auto
mt = hl.read_matrix_table(...).select_globals()

```

(or the equivalent)

When Konrad has had similar errors, this fixes it!

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 14, 2018, 6:29pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/7 "2018-11-14T18:29:55Z")

</div>

yes, I did that

---

<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:** [November 14, 2018, 6:40pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/8 "2018-11-14T18:40:56Z")

</div>

can you do the following and paste the result:

```python
mt = hl.read_matrix_table(...)
print(mt._jvds.globalType().parsableString())
mt = mt.select_globals()
print(mt._jvds.globalType().parsableString())

```

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 14, 2018, 6:43pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/9 "2018-11-14T18:43:38Z")

</div>

+Struct{}  
Struct{}

---

<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:** [November 14, 2018, 6:52pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/10 "2018-11-14T18:52:17Z")

</div>

ah, darn, a recent change broke this hack.

This pull request will fix the problem:

[https://github.com/hail-is/hail/pull/4778](https://github.com/hail-is/hail/pull/4778)

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 15, 2018, 4:10pm UTC](https://discuss.hail.is/t/error-with-mt-s-show/768/11 "2018-11-15T16:10:44Z")

</div>

Hi Tim,

It works! Thanks!
