-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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(python): Add show methods to DataFrame and LazyFrame #19634
base: main
Are you sure you want to change the base?
Conversation
No need to mock There are a few other options it would be nice to expose as well, such as I'd also change the parameter name Footnotes
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19634 +/- ##
==========================================
- Coverage 80.05% 79.93% -0.13%
==========================================
Files 1532 1536 +4
Lines 210752 211721 +969
Branches 2442 2449 +7
==========================================
+ Hits 168715 169230 +515
- Misses 41482 41936 +454
Partials 555 555 ☔ View full report in Codecov by Sentry. |
@alexander-beedie I've added all config options that impact the display format of a dataframe. I was thinking of hiding the dataframe shape by default because I find it a bit irrelevant when showing a dataframe, usually you would know what is the shape of the frame you are working with. But with the limitless option and for the sake of consistency I think I will leave it visible. |
Refactor both `show` methods to use a limit rather than a number of rows to show. The `limit` parameter is an extension of the `n` number of rows parameter, and can be set to None. In that case, the `show` method will display all frame rows.
afe59a5
to
c9653a5
Compare
This adds a show method for both
DataFrame
andLazyFrame
objects, taking inspiration from pyspark's show method and taking into account the requirements from @stinodego in #16534.I choose to only expose config options that influenced the result width's size, to mimic pyspark's
truncate
option.I've provided tests, but I'm not super satisfied with them: they could break when changing the default display options. I was thinking of mocking
Config
,print
anddisplay_html
, would that be okay?