bug fix: truncate wide columns in print.data.table #7788
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7788 +/- ##
=======================================
Coverage 98.85% 98.85%
=======================================
Files 87 87
Lines 17128 17137 +9
=======================================
+ Hits 16932 16941 +9
Misses 196 196 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Generated via commit 6a1d3a8 Download link for the artifact containing the test results: ↓ atime-results.zip
|
| } | ||
|
|
||
| format_col.default = function(x, ...) { | ||
| dots = list(...) |
There was a problem hiding this comment.
could you explain the motivation behind this dots = list(...) pattern? imo it makes the code a lot harder to read, would rather us be more specific about method contracts and declare it as a parameter
There was a problem hiding this comment.
it was done to avoid the codoc mismatch between teh doc and the code , now i have updated the doc and reverted it
|
|
||
| 11. `between()` now supports `Date` and `IDate` bounds with default `NAbounds=TRUE`, avoiding errors like "Not yet implemented NAbounds=TRUE for this non-numeric and non-character type" when date bounds contain `NA`, [#7281](https://github.com/Rdatatable/data.table/issues/7281). Thanks @grcatlin for the report and fix, and @ben-schwen and @aitap for assistance. | ||
|
|
||
| 12. `print.data.table()` now correctly truncates long character columns and list-column summaries to avoid horizontal console overflow, [#7718](https://github.com/Rdatatable/data.table/issues/7718). When `datatable.prettyprint.char` is `NULL` (the default), the truncation limit is now dynamically calculated as `getOption("width") - 5L`. Thanks @tdhock for the report and @venom1204 for the fix. |
There was a problem hiding this comment.
is this still true? also we may not want to be too verbose about implementation details here
There was a problem hiding this comment.
sorry for the news entry I simply gave the previous file forgot to modify it.
tdhock
left a comment
There was a problem hiding this comment.
this looks good, but can you please add some examples in Rd and PR comments (with output) ?

closes #7718
sorry for the new pr ,as there was some error in the previous one
the earlier pr mainly used a fixed getOption("width") - 5L style truncation approach which worked for some simple cases but failed once row labels became larger (for example 1000000:) because the full rendered line width was not being accounted for correctly.
allowNA=TRUEinnchar()calls to avoidinvalid widthfailures during tests,while preserving thr originaldatatable.prettyprint.char.with these changes the ouput now takes the full options(width) limit for the entire rendered line.
hi @joshhwuu @tdhock can you please have a look at it when you got time ,
thanks