Make sure we use MIME when calling repr in GroupedDataFrame printing#3213
Make sure we use MIME when calling repr in GroupedDataFrame printing#3213
Conversation
nalimilan
left a comment
There was a problem hiding this comment.
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.
Why not use a triple-quoted string instead?
There was a problem hiding this comment.
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.
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.
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:
DataFrameRowandGroupedDataFrameprinting are needed to be made in one file).MIME("text/plain)when callingreprto 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.