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

[hail] Teach Expressions to HTML Show #6089

Merged
merged 9 commits into from May 10, 2019

Conversation

Projects
None yet
2 participants
@danking
Copy link
Collaborator

commented May 9, 2019

Summary of Changes

  • Preserve MT structure for entry fields
  • Harmonize MT and T show interface in a backwards compatible way
  • Simplify Expression.show code slightly
  • A comprehensive, colocated set of show tests
@@ -0,0 +1,21 @@
import hail as hl

setUpModule = startTestHailContext

This comment has been minimized.

Copy link
@tpoterba

tpoterba May 9, 2019

Collaborator

name error? needs to be imported

This comment has been minimized.

Copy link
@danking

danking May 9, 2019

Author Collaborator

fixed

@@ -1430,6 +1430,11 @@ def show(self, n=None, width=None, truncate=None, types=True, handler=None):
handler : Callable[[str], Any]
Handler function for data string.
"""
if n_rows is not None and n is not None:

This comment has been minimized.

Copy link
@tpoterba

tpoterba May 9, 2019

Collaborator

I'm a bit confused about this change

This comment has been minimized.

Copy link
@tpoterba

tpoterba May 9, 2019

Collaborator

it's also not typechecked which will create an error.

This comment has been minimized.

Copy link
@danking

danking May 9, 2019

Author Collaborator

I did modify the type check annotation.

In Expression.show I don't want to have an if that calls show(n=n) and show(n=n_rows). I unified the two interfaces so that both Table and MatrixTable call the number of rows to be shown n_rows (and Table continues to support n for legacy reasons).

This comment has been minimized.

Copy link
@tpoterba

tpoterba May 9, 2019

Collaborator

oh, I see. OK, sure


@typecheck_method(n=int, width=int, truncate=nullable(int), types=bool, handler=anyfunc)
def show(self, n=10, width=90, truncate=None, types=True, handler=print):
@typecheck_method(n=int, width=int, truncate=nullable(int), types=bool, handler=nullable(anyfunc))

This comment has been minimized.

Copy link
@tpoterba

tpoterba May 9, 2019

Collaborator

why this change to handlers?

This comment has been minimized.

Copy link
@tpoterba

tpoterba May 9, 2019

Collaborator

d'oh, this is the html fix 🤦‍♂

danking added some commits May 9, 2019

danking added some commits May 9, 2019

@danking danking merged commit 4b7584f into hail-is:master May 10, 2019

1 check passed

ci-test success
Details
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.