-
Notifications
You must be signed in to change notification settings - Fork 368
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
Make sure we use MIME when calling repr in GroupedDataFrame printing #3213
Conversation
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.
Looks good, but can you just detail in what case printing is changed for reference?
test/show.jl
Outdated
|
||
io = IOContext(IOBuffer(), :limit=>true) | ||
show(io, groupby(df, :id)) | ||
@test String(take!(io.io)) === "GroupedDataFrame with 3 groups based on key: id\n" * |
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.
Why not use a triple-quoted string instead?
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.
I was about to write the same comment! Something like that:
"""
GroupedDataFrame with 3 groups based on key: id
First Group (1 row): id = "a"
Row │ id value
│ String1 Int64
─────┼────────────────
1 │ a 1
⋮
Last Group (1 row): id = "c"
Row │ id value
│ String1 Int64
─────┼────────────────
1 │ c 3
"""
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.
I will re-check it (this is what I did initially, but I was getting test errors constantly for some reason I did not understand)
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.
OK - I have managed to find problems. The issues were trailing whitespace in some cases.
What we currently have is:
As you can see While we have:
which is, in general closer to what we want in this case. After this PR the |
Thank you! |
What this PR changes:
DataFrameRow
andGroupedDataFrame
printing are needed to be made in one file).MIME("text/plain)
when callingrepr
to show group label key. This is needed to avoid printing type name in some cases (which is not useful).This resolves the issue that before this change docs building was not passing due to the changes in InlineStrings.jl printing rules.