Repository navigation
Avoid shadowing message in autoprint tests - #7446
Conversation
Comparing ‘autoprint.Rout’ to ‘autoprint.Rout.save’ ...4,10d3 < < Attaching package: 'data.table' < < The following object is masked from 'package:base': < < %notin% <
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7446 +/- ##
=======================================
Coverage 99.07% 99.07%
=======================================
Files 85 85
Lines 16609 16610 +1
=======================================
+ Hits 16455 16456 +1
Misses 154 154 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
is the definition identical? if so we should start a deprecation cycle too |
|
Ours might be faster when both arguments are character vectors; otherwise identical: |
|
I would definitely aim for deprecation, I don't think differences will be that big |
| @@ -1,4 +1,4 @@ | |||
| require(data.table) | |||
| suppressPackageStartupMessages(require(data.table)) | |||
There was a problem hiding this comment.
For this PR I'd prefer require(data.table, exclude="%notin%"), however that's from 3.6.0 (r76248):
Maybe just require(data.table, warn.conflicts=!exists("%notin%", "package:base")) is the most concise way to narrowly skip for only this issue?
With blanket suppress* I worry about missing other such issues in the future.
There was a problem hiding this comment.
That's very concise compared to dynamic call manipulation and testing for 'exclude' %in% names(formals(require))), thank you!
There was a problem hiding this comment.
yea, still not ideal, as it means all future versions turn off conflict warnings. I guess it doesn't matter much for this test anyway -- we could just statically set it to FALSE?
Unfortunately, require(data.table, exclude="%notin") requires R >= 3.6.
|
Three CRAN packages import |
|
An |
* Avoid shadowing message in autoprint tests Comparing ‘autoprint.Rout’ to ‘autoprint.Rout.save’ ...4,10d3 < < Attaching package: 'data.table' < < The following object is masked from 'package:base': < < %notin% < * Suppress conflict messages on new enough R-devel Unfortunately, require(data.table, exclude="%notin") requires R >= 3.6. * Just disable warn.conflicts for now * link issue directly * link issue directly --------- Co-authored-by: Michael Chirico <[email protected]>
R-devel has introduced
base::`%notin%`, whichdata.tablenow shadows, which shows up in the "golden" output test:Use
suppressPackageStartupMessages(...)in the test to avoid the message.@TysonStanley, I think this is needed for cherry-picking to avoid an extra NOTE.