You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by np...@apache.org on 2022/05/06 19:17:32 UTC

[arrow] branch master updated: MINOR: [R] Don't use warning() in .onLoad()

This is an automated email from the ASF dual-hosted git repository.

npr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 1aa4dd6771 MINOR: [R] Don't use warning() in .onLoad()
1aa4dd6771 is described below

commit 1aa4dd67717eaf5cb6cadbd460745e64544214f4
Author: Neal Richardson <ne...@gmail.com>
AuthorDate: Fri May 6 15:17:23 2022 -0400

    MINOR: [R] Don't use warning() in .onLoad()
    
    According to the [docs](https://stat.ethz.ch/R-manual/R-devel/library/base/html/ns-hooks.html), `packageStartupMessage()` is preferred. With `warning()`, it can show up in the `R CMD INSTALL` output like this:
    
    ```
    installing to D:/a/_temp/Library/00LOCK-arrow/00new/arrow/libs/x64
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Warning in fun(libname, pkgname) :
      The tzdb package is not installed. Timezones will not be available.
    ** testing if installed package can be loaded from final location
    Warning in fun(libname, pkgname) :
    ** testing if installed package keeps a record of temporary installation path
      The tzdb package is not installed. Timezones will not be available.
    * MD5 sums
    packaged installation of 'arrow' as arrow_7.0.0.20220505.zip
    * DONE (arrow)
    ```
    
    I will cherry-pick when preparing the 8.0.0 CRAN submission
    
    Closes #13085 from nealrichardson/load-warning
    
    Authored-by: Neal Richardson <ne...@gmail.com>
    Signed-off-by: Neal Richardson <ne...@gmail.com>
---
 r/R/arrow-package.R | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/r/R/arrow-package.R b/r/R/arrow-package.R
index c7bcb1b63b..1b2e7691ef 100644
--- a/r/R/arrow-package.R
+++ b/r/R/arrow-package.R
@@ -76,7 +76,7 @@
       tzdb::tzdb_initialize()
       set_timezone_database(tzdb::tzdb_path("text"))
     } else {
-      warning("The tzdb package is not installed. Timezones will not be available.")
+      packageStartupMessage("The tzdb package is not installed. Timezones will not be available.")
     }
   }