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
Merged

Conversation

@danking
Copy link
Collaborator

@danking danking 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
Copy link
Collaborator

@tpoterba tpoterba May 9, 2019

name error? needs to be imported

Copy link
Collaborator Author

@danking danking May 9, 2019

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:
Copy link
Collaborator

@tpoterba tpoterba May 9, 2019

I'm a bit confused about this change

Copy link
Collaborator

@tpoterba tpoterba May 9, 2019

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

Copy link
Collaborator Author

@danking danking May 9, 2019

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).

Copy link
Collaborator

@tpoterba tpoterba May 9, 2019

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))
Copy link
Collaborator

@tpoterba tpoterba May 9, 2019

why this change to handlers?

Copy link
Collaborator

@tpoterba tpoterba May 9, 2019

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

@danking danking merged commit 4b7584f into hail-is:master May 10, 2019
1 check passed
@danking danking deleted the fix-expression-show branch Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants