-
Notifications
You must be signed in to change notification settings - Fork 608
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
feat(ux): add Table and Column.preview() #7408
Conversation
e2bdf5b
to
d099dbb
Compare
doctests seems to be failing, I think because
aren't quite equivalent. But I don't really see what should be done here, should 2 be what happens in both .preview() and interactive_rich_console()? I'm not that famliar with the rich API/stack. |
I would love to get this fixed and merged. Does this look like the generally right idea? Can you point me in the right direction on my rich API question above (and I can fix it up myself)? |
Hey @cpcloud if I figure out the issues and fix them will this get merged? I don't want to do that effort though if this isn't the right direction at all. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to give this a review!
I think this is a useful method for folks that want to customize the way the output looks.
self, | ||
*, | ||
max_rows: int | None = None, | ||
show_types: bool | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this out for now. I'm not even sure it's a useful option to have in general.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by "this" do you just mean the "show_types" arg? yeah I sort of agree I feel like it should always be True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, was asking about show_types
.
max_length: int | None = None, | ||
max_string: int | None = None, | ||
max_depth: int | None = None, | ||
console_width: int | float | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there cases when this is a useful option to set when using ibis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So one of the motivators for this PR was better UX when using the VSCode debugger. Currently this PR doesn't quite work yet:
Ideally this would show the table nicely. But I noticed when I did the workaround of converting to pandas, that the console width seems to be small and I get ugly wrapping:
I was guessing that this console_width
param was needed so the output would be pretty. But perhaps I was getting ahead of myself. we leave it out for now, and cross that bridge when we come to it?
@cpcloud a larger API question is: Should I might argue for a kwarg like ![]() ![]() I would like it to work where I can just call |
@NickCrews Would you mind reopening this PR against |
fixes #7172
I wasn't sure how testing this should work so I didn't add any tests. I would really appreciate it if someone more familiar could pick this up and finish it off, I think I've gotten a lot of it out of the way.
Hopefully I've implemented this is such a way that it is testable.
Things I'm not sure about: