Skip to content

Resolved off by one bug in print.trunc.cols #7716 #7717 - #7923

Open
anmolsriwastava wants to merge 10 commits into
Rdatatable:masterfrom
anmolsriwastava:fix-7716
Open

anmolsriwastava wants to merge 10 commits into
Rdatatable:masterfrom
anmolsriwastava:fix-7716

Conversation

@anmolsriwastava

@anmolsriwastava anmolsriwastava commented Oct 16, 2026 •

Copy link
Copy Markdown

Closes #7716.
Closes #7717.

Fixed two issues in print.data.table truncation:

  1. Changed widths < cons_width to widths <= cons_width so a table exactly matching the console width prints instead of being truncated.
  2. Removed the - 3L in the trunc.char calculation so content that fits is not unnecessarily truncated.
  3. Dropped the first column and recalculated width if it is too long, printing the "not shown" message above the table (so fixed print.trunc.cols shows nothing if first column is too long #7717).

Added tests 2388.25 and 2388.26

@anmolsriwastava anmolsriwastava changed the title Resolved off by one bug in print.trunc.cols #7716 Resolved off by one bug in print.trunc.cols #7716 #7717 Oct 17, 2026
@joshhwuu

Copy link
Copy Markdown
Member

thanks! old tests are failing in CI, have you tried running them locally first?

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.00%. Comparing base (9dcf82f) to head (1c6242d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7923      +/-   ##
==========================================
- Coverage   99.02%   99.00%   -0.02%     
==========================================
  Files          88       88              
  Lines       17388    17393       +5     
==========================================
+ Hits        17218    17220       +2     
- Misses        170      173       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anmolsriwastava

anmolsriwastava commented Oct 18, 2026 •

Copy link
Copy Markdown
Author

Hi @joshhwuu and @MichaelChirico , the R CMD check tests are finally passing on all platforms!! it looks like the lint-r job is failing on R/setops.R (line 20), which is a pre-existing lint error on master and unrelated to my changes in print.data.table.R

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

print.trunc.cols shows nothing if first column is too long print.trunc.cols off by one?

2 participants