You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by jo...@apache.org on 2022/04/08 22:22:26 UTC

[arrow] branch master updated: ARROW-16156: [R] Clarify warning message for features not turned on in .onAttach()

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

jonkeane 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 961ec771b9 ARROW-16156: [R] Clarify warning message for features not turned on in .onAttach()
961ec771b9 is described below

commit 961ec771b9bb84b71be3af398e7b3df3e10f291b
Author: Dewey Dunnington <de...@fishandwhistle.net>
AuthorDate: Fri Apr 8 17:22:16 2022 -0500

    ARROW-16156: [R] Clarify warning message for features not turned on in .onAttach()
    
    After ARROW-15818 (#12564) we get an extra message on package load because "engine" was added to `arrow_info()$capabilities` and few if any users will have this turned on for at least the next release:
    
    ```r
    library(arrow)
    #> See arrow_info() for available features
    ```
    
    This PR adds "engine" to the list of features we don't message users about and clarifies the message so that it's more clear why it's being shown:
    
    ```r
    library(arrow)
    #> Some features of Arrow C++ are turned off. Run `arrow_info()` for more information.
    ```
    
    Closes #12842 from paleolimbot/r-onattach
    
    Lead-authored-by: Dewey Dunnington <de...@fishandwhistle.net>
    Co-authored-by: Jonathan Keane <jk...@gmail.com>
    Signed-off-by: Jonathan Keane <jk...@gmail.com>
---
 r/R/arrow-package.R | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/r/R/arrow-package.R b/r/R/arrow-package.R
index 896363a478..3c810bb8f2 100644
--- a/r/R/arrow-package.R
+++ b/r/R/arrow-package.R
@@ -107,7 +107,12 @@
       #
       # Let's print a message if some are off
       if (some_features_are_off(features)) {
-        packageStartupMessage("See arrow_info() for available features")
+        packageStartupMessage(
+          paste(
+            "Some features are not enabled in this build of Arrow.",
+            "Run `arrow_info()` for more information."
+          )
+        )
       }
     })
   }
@@ -264,7 +269,7 @@ arrow_info <- function() {
 some_features_are_off <- function(features) {
   # `features` is a named logical vector (as in arrow_info()$capabilities)
   # Let's exclude some less relevant ones
-  blocklist <- c("lzo", "bz2", "brotli")
+  blocklist <- c("lzo", "bz2", "brotli", "engine")
   # Return TRUE if any of the other features are FALSE
   !all(features[setdiff(names(features), blocklist)])
 }