Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign updata.table:::print.data.table sometimes returns visibly, however it should be invisible #1852
Comments
Closes #1852 -- print(null.data.table()) no longer visibly returns NULL
Reverse dependency testing revealed `SpaDES.core` will break with the data.table v1.11.0 update to CRAN. Bug fix 8 in v1.11.0 NEWS is : > 8. Printing a null `data.table` with `print` no longer visibly outputs `NULL`, [#1852](Rdatatable/data.table#1852). Thanks @aaronmcdaid for spotting and @MichaelChirico for the PR. This PR should make SpaDES.core pass R CMD check with data.table both before and after v1.11.0 The failure is : ``` ── 1. Failure: simList object initializes correctly (@test-simList.R#17) ────────────────────────── length(out) not equal to 75. 1/1 mismatches [1] 73 - 75 == -2 ══ testthat results ═══════════════════════════════════════════════════════════ OK: 349 SKIPPED: 33 FAILED: 1 1. Failure: simList object initializes correctly (@test-simList.R#17) ```
Typing
xon its own calls the data.table print method:Typing
print(x)should give the same result as above, however there is extra output:Very low priority I guess, but a bug nonetheless (I think).
I think it's because, in such cases, the return statement (within the code for
data.table:::print.data.table) is as follows:However, it should return invisibly, as expected by the
?printdocumentationThe method should return the value (not
NULL) and it should return invisibly. Something like: