Skip to content

Commit 8c11e2d

Browse files
Mukulyadav2004aitap
authored andcommitted
Fix index printing by adding index info to header (Rdatatable#6816)
Produce the class header from `toprint` instead of just `x`. Fixes: Rdatatable#6806 Co-authored-by: Ivan K <krylov.r00t@gmail.com>
1 parent b8f4fd0 commit 8c11e2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inst/tests/tests.Rraw

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21076,6 +21076,12 @@ setindex(DT, b)
2107621076
# can't use output= here because the print() call is outside withCallingHandlers(...)
2107721077
test(2307, { capture.output(print(DT, class = TRUE, show.indices = TRUE)); TRUE })
2107821078

21079+
DT <- data.table(a = 1:2, b = 2:1)
21080+
setindex(DT, b)
21081+
# make sure that print(DT) doesn't warn due to the header missing index column types, #6806
21082+
# can't use output= here because the print() call is outside withCallingHandlers(...)
21083+
test(2307, { capture.output(print(DT, class = TRUE, show.indices = TRUE)); TRUE })
21084+
2107921085
<<<<<<< HEAD
2108021086
if (exists("sort_by", "package:base")) {
2108121087
# sort_by.data.table

0 commit comments

Comments
 (0)