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

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


The following commit(s) were added to refs/heads/main by this push:
     new 84a4ab1820 GH-38228: [R] Fence examples that need dataset with 
`examplesIf` (#38229)
84a4ab1820 is described below

commit 84a4ab18209ae3677a1227cc42e5a52d91fc6f86
Author: Dewey Dunnington <[email protected]>
AuthorDate: Thu Oct 12 09:43:12 2023 -0300

    GH-38228: [R] Fence examples that need dataset with `examplesIf` (#38229)
    
    ### Rationale for this change
    
    The minimal nightly build are failing with examples that won't run without 
the dataset feature
    
    ### What changes are included in this PR?
    
    - Added `examplesIf` where needed
    - Redocumented
    
    ### Are these changes tested?
    
    Yes, by all R CMD check jobs
    
    ### Are there any user-facing changes?
    
    No
    * Closes: #38228
    
    Authored-by: Dewey Dunnington <[email protected]>
    Signed-off-by: Dewey Dunnington <[email protected]>
---
 r/R/csv.R                    | 6 +++---
 r/man/arrow-package.Rd       | 1 +
 r/man/csv_convert_options.Rd | 2 ++
 r/man/csv_parse_options.Rd   | 2 ++
 r/man/csv_read_options.Rd    | 2 ++
 5 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/r/R/csv.R b/r/R/csv.R
index ef35c7d6d5..11e5b5d808 100644
--- a/r/R/csv.R
+++ b/r/R/csv.R
@@ -412,7 +412,7 @@ CsvTableReader$create <- function(file,
 #'      - column names are read (unless `column_names` is set);
 #'      - `skip_rows_after_names` is applied (if non-zero).
 #'
-#' @examples
+#' @examplesIf arrow_with_dataset()
 #' tf <- tempfile()
 #' on.exit(unlink(tf))
 #' writeLines("my file has a non-data header\nx\n1\n2", tf)
@@ -672,7 +672,7 @@ readr_to_csv_read_options <- function(skip = 0, col_names = 
TRUE) {
 #'    and LF (`0x0a`) characters?
 #' @param ignore_empty_lines Logical: should empty lines be ignored (default) 
or
 #'    generate a row of missing values (if `FALSE`)?
-#' @examples
+#' @examplesIf arrow_with_dataset()
 #' tf <- tempfile()
 #' on.exit(unlink(tf))
 #' writeLines("x\n1\n\n2", tf)
@@ -780,7 +780,7 @@ TimestampParser$create <- function(format = NULL) {
 #'    (c) a list of [TimestampParser] objects.
 #' @param decimal_point Character to use for decimal point in floating point 
numbers.
 #'
-#' @examples
+#' @examplesIf arrow_with_dataset()
 #' tf <- tempfile()
 #' on.exit(unlink(tf))
 #' writeLines("x\n1\nNULL\n2\nNA", tf)
diff --git a/r/man/arrow-package.Rd b/r/man/arrow-package.Rd
index 2edd09dfb2..15f672a1fe 100644
--- a/r/man/arrow-package.Rd
+++ b/r/man/arrow-package.Rd
@@ -29,6 +29,7 @@ Authors:
   \item Jonathan Keane \email{[email protected]}
   \item Dragoș Moldovan-Grünfeld \email{[email protected]}
   \item Jeroen Ooms \email{[email protected]}
+  \item Jacob Wujciak-Jens \email{[email protected]}
   \item Apache Arrow \email{[email protected]} [copyright holder]
 }
 
diff --git a/r/man/csv_convert_options.Rd b/r/man/csv_convert_options.Rd
index f48da56eaa..664a19ce15 100644
--- a/r/man/csv_convert_options.Rd
+++ b/r/man/csv_convert_options.Rd
@@ -64,9 +64,11 @@ starting from the beginning of this vector. Possible values 
are
 CSV Convert Options
 }
 \examples{
+\dontshow{if (arrow_with_dataset()) (if (getRversion() >= "3.4") withAutoprint 
else force)(\{ # examplesIf}
 tf <- tempfile()
 on.exit(unlink(tf))
 writeLines("x\n1\nNULL\n2\nNA", tf)
 read_csv_arrow(tf, convert_options = csv_convert_options(null_values = c("", 
"NA", "NULL")))
 open_csv_dataset(tf, convert_options = csv_convert_options(null_values = c("", 
"NA", "NULL")))
+\dontshow{\}) # examplesIf}
 }
diff --git a/r/man/csv_parse_options.Rd b/r/man/csv_parse_options.Rd
index 23c647470b..57b2b5784b 100644
--- a/r/man/csv_parse_options.Rd
+++ b/r/man/csv_parse_options.Rd
@@ -38,9 +38,11 @@ generate a row of missing values (if \code{FALSE})?}
 CSV Parsing Options
 }
 \examples{
+\dontshow{if (arrow_with_dataset()) (if (getRversion() >= "3.4") withAutoprint 
else force)(\{ # examplesIf}
 tf <- tempfile()
 on.exit(unlink(tf))
 writeLines("x\n1\n\n2", tf)
 read_csv_arrow(tf, parse_options = csv_parse_options(ignore_empty_lines = 
FALSE))
 open_csv_dataset(tf, parse_options = csv_parse_options(ignore_empty_lines = 
FALSE))
+\dontshow{\}) # examplesIf}
 }
diff --git a/r/man/csv_read_options.Rd b/r/man/csv_read_options.Rd
index 622e8d5e5b..af38fe457b 100644
--- a/r/man/csv_read_options.Rd
+++ b/r/man/csv_read_options.Rd
@@ -43,9 +43,11 @@ The order of application is as follows:
 CSV Reading Options
 }
 \examples{
+\dontshow{if (arrow_with_dataset()) (if (getRversion() >= "3.4") withAutoprint 
else force)(\{ # examplesIf}
 tf <- tempfile()
 on.exit(unlink(tf))
 writeLines("my file has a non-data header\nx\n1\n2", tf)
 read_csv_arrow(tf, read_options = csv_read_options(skip_rows = 1))
 open_csv_dataset(tf, read_options = csv_read_options(skip_rows = 1))
+\dontshow{\}) # examplesIf}
 }

Reply via email to