-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix truncation of long column names in print.data.table() #7802
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
Open
venom1204
wants to merge
8
commits into
master
Choose a base branch
from
issue7797
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+25
−12
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
249fd7a
updaqted
venom1204 4200f70
Merge remote-tracking branch 'origin/master' into issue7797
venom1204 ab897c5
added tests
venom1204 30a00ef
lintr
venom1204 c4b3481
testb add
venom1204 52990f1
removed blank lines
venom1204 9873073
..
venom1204 3699adc
added test
venom1204 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21683,3 +21683,12 @@ max_ppsize = local({ | |
| x = as.data.table(as.list(1:max_ppsize)) | ||
| test(2376, rbindlist(list(x)), x) | ||
| rm(x, max_ppsize) | ||
|
|
||
| #7797 long column names go past width | ||
| test(2377.1, print(data.table(abcdefghijklmnopqrstuvwxyz=1)), output="abcdefghijklmn...", options=list(width=20)) | ||
| test(2377.2, print(data.table(abcdefghijklmnopqrstuvwxyz=1)), output="1 variable not shown: \\[abcdefghijklmn... <num>\\]", options=list(width=20, datatable.print.trunc.cols=TRUE, datatable.print.class=TRUE)) | ||
| test(2377.3, print(data.table(abcdefghijklmnopqrst=1)), output="abcdefghijklmnopqrst", options=list(width=30)) | ||
| test(2377.4, print(data.table(abcdefghijklmnopqrstuvwxyz=1, zyxwvutsrqponmlkjihgfedcba=2)), output="zyxwvutsrqponm...", options=list(width=40, datatable.print.trunc.cols=TRUE)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like we're only asserting the footer output here? can we make the assertions stronger? |
||
| test(2377.5, print(data.table(abcdefghijklmnopqrstuvwxyz=1)), output="1 variable not shown: \\[abcdefghijklmn... <num>\\]", options=list(width=20, datatable.print.trunc.cols=TRUE, datatable.print.class=TRUE, datatable.prettyprint.char=Inf)) | ||
| test(2377.6, print(data.table(very_long_name_a=1, s_b=2, very_long_name_c=3)), output="very_long_name_a[ ]+s_b.*1 variable not shown: \\[very_long_name_c <num>\\]", options=list(width=35, datatable.print.trunc.cols=TRUE, datatable.print.class=TRUE)) | ||
| test(2377.7, print(data.table(extremely_long_a=1, s_b=2, extremely_long_c=3, s_d=4)), output="extremely_long_a[ ]+s_b.*2 variables not shown: \\[extremely_long_c <num>, s_d <num>\\]", options=list(width=30, datatable.print.trunc.cols=TRUE, datatable.print.class=TRUE)) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
please add a test with more than one column.
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 added two tests , are they satisfying what you were excpecting.
thanks.