-
Notifications
You must be signed in to change notification settings - Fork 985
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
add format_list_item.data.frame #6593
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6593 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 79 79
Lines 14534 14535 +1
=======================================
+ Hits 14333 14334 +1
Misses 201 201 ☔ View full report in Codecov by Sentry. |
Can you check if this fixes #5948, or if the fix there is related? |
inst/tests/tests.Rraw
Outdated
test(2297.03, format_list_item(data.frame(a=1)[,0]), output = "<data.frame\\[1x0]>") | ||
test(2297.04, format_list_item(data.frame(a=1, b=2)[0,,drop=FALSE]), output = "<data.frame\\[0x2]>") | ||
test(2297.05, format_list_item(data.frame(a=1, b=2)[,0]), output = "<data.frame\\[1x0]>") | ||
test(2297.06, format_list_item(data.table(a=1)), output = "<data.table\\[1x1]>") | ||
test(2297.07, format_list_item(data.table(a=1)[0,]), output = "<data.table\\[0x1]>") | ||
test(2297.08, format_list_item(data.table(a=1)[,0]), output = "<data.table\\[0x0]>") | ||
test(2297.09, format_list_item(data.table(a=1, b=2)[0,]), output = "<data.table\\[0x2]>") | ||
test(2297.10, format_list_item(data.table(a=1, b=2)[,0]), output = "<data.table\\[0x0]>") |
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.
test(2297.03, format_list_item(data.frame(a=1)[,0]), output = "<data.frame\\[1x0]>") | |
test(2297.04, format_list_item(data.frame(a=1, b=2)[0,,drop=FALSE]), output = "<data.frame\\[0x2]>") | |
test(2297.05, format_list_item(data.frame(a=1, b=2)[,0]), output = "<data.frame\\[1x0]>") | |
test(2297.06, format_list_item(data.table(a=1)), output = "<data.table\\[1x1]>") | |
test(2297.07, format_list_item(data.table(a=1)[0,]), output = "<data.table\\[0x1]>") | |
test(2297.08, format_list_item(data.table(a=1)[,0]), output = "<data.table\\[0x0]>") | |
test(2297.09, format_list_item(data.table(a=1, b=2)[0,]), output = "<data.table\\[0x2]>") | |
test(2297.10, format_list_item(data.table(a=1, b=2)[,0]), output = "<data.table\\[0x0]>") | |
test(2297.03, format_list_item(data.frame(a=1)[,0]), output = "<data.frame\\[1x0]>") | |
test(2297.04, format_list_item(data.frame(a=1, b=2)[0,,drop=FALSE]), output = "<data.frame\\[0x2]>") | |
test(2297.06, format_list_item(data.table(a=1)), output = "<data.table\\[1x1]>") | |
test(2297.07, format_list_item(data.table(a=numeric())), output = "<data.table\\[0x1]>") | |
test(2297.08, format_list_item(data.table(), output = "<data.table\\[0x0]>") | |
test(2297.09, format_list_item(data.table(a=numeric(), b=numeric())), output = "<data.table\\[0x2]>") |
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 think the two [1x0]
and [0x0]
tests are redundant, right? removed in the suggested fix.
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 tried to do a simple expansion of 0, 1, and >1 for number of columns, and 0, 1 rows, not knowing if you were aware of other corner-cases. (This is partly because I discovered during testing that data.frame(b=1)[,0]
is 1x0
whereas data.table(b=1)[,0]
is 0x0
. Not sure if that's intentional.) I'm happy to remove them.
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.
Yes, it's intentional -- #2422 :)
Thanks LGTM besides the small tweak to tests & request for whether this can fix a 2nd bug. |
This does not affect #5948, I think my comment there covers it. LMK if there's something else for this PR. |
stby, I didn't QA the changes, I'll fix that fail |
Thanks @r2evans! I've sent you an invite to join as a project member. Most notably, that will let you create branches directly on this repo going forward which simplifies collaboration a bit. I'm also adding you as a contributor to the DESCRIPTION |
Closes #6592, nested 1-column frames break print.data.table