Skip to content

Fix truncation of long column names in print.data.table()#7802

Open
venom1204 wants to merge 8 commits into
masterfrom
issue7797
Open

Fix truncation of long column names in print.data.table()#7802
venom1204 wants to merge 8 commits into
masterfrom
issue7797

Conversation

@venom1204

Copy link
Copy Markdown
Contributor

closes #7797

apply width based truncation to long column names when printing data.tables, ensuring that table headers and hidden-column footers respect the available console width.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.85%. Comparing base (deb9acc) to head (3699adc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7802   +/-   ##
=======================================
  Coverage   98.85%   98.85%           
=======================================
  Files          87       87           
  Lines       17140    17142    +2     
=======================================
+ Hits        16944    16946    +2     
  Misses        196      196           

☔ 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.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
  • HEAD=issue7797 much slower for as.data.table.array improved in #7019
  • HEAD=issue7797 much slower for transform improved in #5493
  • HEAD=issue7797 slower P<0.001 for DT[by] max regression fixed in #7480
  • HEAD=issue7797 faster P<0.001 for memrecycle regression fixed in #5463
    Comparison Plot

Generated via commit 3699adc

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 6 minutes and 16 seconds
Installing different package versions 11 minutes and 25 seconds
Running and plotting the test cases 5 minutes and 26 seconds

@venom1204 venom1204 requested review from joshhwuu and tdhock June 24, 2026 20:06
Comment thread inst/tests/tests.Rraw

#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))

Copy link
Copy Markdown
Member

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.

  • 3 cols: two too long, one not
  • 4 cols: one too long, next not, next too long, next not
  • etc

Copy link
Copy Markdown
Contributor Author

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.

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.

long column names go past width

2 participants