[hail] Showing a negative number prints the whole table.#6226
[hail] Showing a negative number prints the whole table.#6226danking merged 3 commits intohail-is:masterfrom
Conversation
We had these semantics in our interface in the past, which was lost in the Python reimplementation. Fixes hail-is#6122
hail/python/hail/table.py
Outdated
| else: | ||
| rows = formatted_t.take(n + 1) | ||
| has_more = len(rows) > n | ||
| rows = rows[:n] |
There was a problem hiding this comment.
Could you put these in a helper that returns (rows, has_more)?
|
reassigned to @jigold since Daniel is out |
|
|
||
| def _take_n(self, n): | ||
| if n < 0: | ||
| rows = self.collect() |
There was a problem hiding this comment.
I think of a negative number as the equivalent of tail. Since you're collecting all of the data anyways, i think you can implement this.
There was a problem hiding this comment.
we had these semantics before show() was rewritten in Python -- I'm reticent to change them now. I also don't want to implement showing the tail as collecting all the data -- people would try to use it and immediately run OOM.
I'm OK supporting a tail=True parameter on show() in the future, but we need to write an implementation that doesn't require localizing all the data.
There was a problem hiding this comment.
In that case, can we add something to the docs that states what a negative argument does?
We had these semantics in our interface in the past, which was
lost in the Python reimplementation.
Fixes #6122