Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table.show() errors when table is empty #5173

Closed
lfrancioli opened this issue Jan 18, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@lfrancioli
Copy link
Collaborator

commented Jan 18, 2019

To report a bug, fill in the information below.
For support and feature requests, please use the discussion forum: http://discuss.hail.is/


Hail version: 0.2.8-844023079796

What you did:

x = hl.utils.range_table(100)
x = x.filter(False)
x.show()

What went wrong (all error messages here, including the full java stack trace):

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-89-65d54ebb6a64> in <module>
      1 x = hl.utils.range_table(100)
      2 x = x.filter(False)
----> 3 x.show()

/home/hail/gnomad_hail/utils/plotting.py in new_show(t, n, width, truncate, types)
     25 
     26     def new_show(t, n=10, width=140, truncate=40, types=True):
---> 27         old_show(t, n, width, truncate, types)
     28     hl.Table.show = new_show
     29 

<decorator-gen-848> 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/table.py in show(self, n, width, truncate, types, handler)
   1331             Handler function for data string.
   1332         """
-> 1333         handler(self._show(n, width, truncate, types))
   1334 
   1335     def index(self, *exprs):

/home/hail/hail.zip/hail/table.py in _show(self, n, width, truncate, types)
   1238 
   1239         column_width = [max(len(fields[i]), len(types[i]), max([len(row[i]) for row in rows]))
-> 1240                         for i in range(n_fields)]
   1241 
   1242         column_blocks = []

/home/hail/hail.zip/hail/table.py in <listcomp>(.0)
   1238 
   1239         column_width = [max(len(fields[i]), len(types[i]), max([len(row[i]) for row in rows]))
-> 1240                         for i in range(n_fields)]
   1241 
   1242         column_blocks = []

ValueError: max() arg is an empty sequence

tpoterba added a commit to tpoterba/hail that referenced this issue Jan 22, 2019

danking added a commit that referenced this issue Jan 22, 2019

Fix show for empty tables (#5180)
* Fix show for empty tables

fixes #5173

* use itertools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.