jonkeane commented on code in PR #12867:
URL: https://github.com/apache/arrow/pull/12867#discussion_r849904322
##########
r/tests/testthat/helper-arrow.R:
##########
@@ -56,6 +56,18 @@ test_that <- function(what, code) {
})
}
+# backport of 4.0.0 implementation
+suppressWarnings <- function (expr, classes = "warning") {
+ withCallingHandlers(
+ expr,
+ warning = function(w) {
+ if (inherits(w, classes)) {
+ invokeRestart("muffleWarning")
+ }
+ }
+ )
+}
Review Comment:
Could we wrap this in an `if(getRversion() < "4.0.0") {...}` So that we can
continue using the official `suppressWarnings()` (with the additions of
tryInvokeRestart, etc.) for versions that support it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]