You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by pa...@apache.org on 2023/06/14 23:59:20 UTC
[arrow-adbc] branch main updated: chore(r/adbcdrivermanager): Clean up driver manager to prepare for CRAN release (#756)
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-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 79a67632 chore(r/adbcdrivermanager): Clean up driver manager to prepare for CRAN release (#756)
79a67632 is described below
commit 79a676320fc03e8b4ec17ac939108234989a21df
Author: Dewey Dunnington <de...@voltrondata.com>
AuthorDate: Wed Jun 14 20:59:15 2023 -0300
chore(r/adbcdrivermanager): Clean up driver manager to prepare for CRAN release (#756)
Basically a dry-run of the actual release checklist (#754). The goal
here is not "world's best documentation", just "enough documentation to
pass the CRAN incoming check. After the initial submission (which is
gated by a human), most releases will be automatic (particularly for a
package like this one, which doesn't have a large surface contact with
third-party dependencies or vendored code).
---
dev/release/rat_exclude_files.txt | 1 +
r/adbcdrivermanager/.Rbuildignore | 1 +
r/adbcdrivermanager/.aspell/arrow-adbc.rds | Bin 55 -> 0 bytes
r/adbcdrivermanager/.aspell/defaults.R | 21 -----------
r/adbcdrivermanager/DESCRIPTION | 18 +++++-----
r/adbcdrivermanager/R/adbc.R | 37 ++++++++++++-------
r/adbcdrivermanager/README.Rmd | 6 ++++
r/adbcdrivermanager/README.md | 39 ++++++++++++---------
r/adbcdrivermanager/cran-comments.md | 6 ++++
.../man/adbc_connection_get_info.Rd | 29 ++++++++++-----
.../man/adbcdrivermanager-package.Rd | 9 +++--
r/adbcdrivermanager/src/error.cc | 4 ++-
r/adbcdrivermanager/src/radbc.cc | 9 +++--
13 files changed, 106 insertions(+), 74 deletions(-)
diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt
index 3088f925..e72973c4 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -17,6 +17,7 @@ java/.mvn/jvm.config
rat.txt
r/adbcdrivermanager/DESCRIPTION
r/adbcdrivermanager/NAMESPACE
+r/adbcdrivermanager/cran-comments.md
r/adbcdrivermanager/.Rbuildignore
r/adbcdrivermanager/tests/testthat/_snaps/*
r/adbcsqlite/DESCRIPTION
diff --git a/r/adbcdrivermanager/.Rbuildignore b/r/adbcdrivermanager/.Rbuildignore
index ed06fac5..9049d730 100644
--- a/r/adbcdrivermanager/.Rbuildignore
+++ b/r/adbcdrivermanager/.Rbuildignore
@@ -8,3 +8,4 @@
^\.github$
^\.covrignore$
^bootstrap\.R$
+^cran-comments\.md$
diff --git a/r/adbcdrivermanager/.aspell/arrow-adbc.rds b/r/adbcdrivermanager/.aspell/arrow-adbc.rds
deleted file mode 100644
index 75c1cca5..00000000
Binary files a/r/adbcdrivermanager/.aspell/arrow-adbc.rds and /dev/null differ
diff --git a/r/adbcdrivermanager/.aspell/defaults.R b/r/adbcdrivermanager/.aspell/defaults.R
deleted file mode 100644
index 49d71e09..00000000
--- a/r/adbcdrivermanager/.aspell/defaults.R
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-Rd_files <- vignettes <- R_files <- description <-
- list(encoding = "UTF-8",
- language = "en",
- dictionaries = c("en_stats", "arrow-adbc"))
diff --git a/r/adbcdrivermanager/DESCRIPTION b/r/adbcdrivermanager/DESCRIPTION
index 7cba8d6e..33353971 100644
--- a/r/adbcdrivermanager/DESCRIPTION
+++ b/r/adbcdrivermanager/DESCRIPTION
@@ -1,21 +1,21 @@
Package: adbcdrivermanager
-Title: Arrow Database Connectivity (ADBC) Driver Manager
+Title: 'Arrow' Database Connectivity ('ADBC') Driver Manager
Version: 0.4.0.9000
Authors@R: c(
person("Dewey", "Dunnington", , "dewey@dunnington.ca", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-9415-4582")),
- person("Apache Arrow", email = "dev@arrow.apache.org", role = c("aut", "cph"))
+ person("Apache Arrow", email = "dev@arrow.apache.org", role = c("aut", "cph")),
+ person("Apache Software Foundation", email = "dev@arrow.apache.org", role = c("cph"))
)
-Description: Provides a developer-facing interface to Arrow Database
- Connectivity (ADBC) for the purposes of driver development, driver
- testing, and building high-level database interfaces for users. ADBC
- is an API standard for database access libraries that uses Arrow for
+Description: Provides a developer-facing interface to 'Arrow' Database
+ Connectivity ('ADBC') for the purposes of driver development, driver
+ testing, and building high-level database interfaces for users. 'ADBC'
+ is an API standard for database access libraries that uses 'Arrow' for
result sets and query parameters.
License: Apache License (>= 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
-SystemRequirements: C++11
Suggests:
testthat (>= 3.0.0),
withr
@@ -24,6 +24,4 @@ Config/build/bootstrap: TRUE
URL: https://github.com/apache/arrow-adbc
BugReports: https://github.com/apache/arrow-adbc/issues
Imports:
- nanoarrow (>= 0.1.0.9000)
-Remotes:
- nanoarrow=apache/arrow-nanoarrow/r
+ nanoarrow
diff --git a/r/adbcdrivermanager/R/adbc.R b/r/adbcdrivermanager/R/adbc.R
index 2cd080c9..dd6a1548 100644
--- a/r/adbcdrivermanager/R/adbc.R
+++ b/r/adbcdrivermanager/R/adbc.R
@@ -173,23 +173,34 @@ adbc_connection_release <- function(connection) {
#' Connection methods
#'
#' @inheritParams adbc_connection_init
-#' @param info_codes (Currently undocumented)
-#' @param depth (Currently undocumented)
-#' @param catalog (Currently undocumented)
-#' @param db_schema (Currently undocumented)
-#' @param table_name (Currently undocumented)
-#' @param table_type (Currently undocumented)
-#' @param column_name (Currently undocumented)
-#' @param serialized_partition (Currently undocumented)
+#' @param info_codes A list of metadata codes to fetch, or NULL to fetch all.
+#' Valid values are documented in the adbc.h header.
+#' @param depth The level of nesting to display. If 0, display all levels. If 1,
+#' display only catalogs (i.e. catalog_schemas will be null). If 2, display
+#' only catalogs and schemas (i.e. db_schema_tables will be null), and so on.
+#' @param catalog Only show tables in the given catalog. If NULL, do not filter
+#' by catalog. If an empty string, only show tables without a catalog. May be
+#' a search pattern.
+#' @param db_schema Only show tables in the given database schema. If NULL, do
+#' not filter by database schema. If an empty string, only show tables without
+#' a database schema. May be a search pattern.
+#' @param table_name Only show tables with the given name. If NULL, do not
+#' filter by name. May be a search pattern.
+#' @param table_type Only show tables matching one of the given table types. If
+#' NULL, show tables of any type. Valid table types can be fetched from
+#' GetTableTypes. Terminate the list with a NULL entry.
+#' @param column_name Only show columns with the given name. If NULL, do not
+#' filter by name. May be a search pattern.
+#' @param serialized_partition The partition descriptor.
#'
#' @return
-#' - `adbc_connection_get_info()`, `adbc_connection_get_objects`,
-#' `adbc_connection_get_table_types()`, and `adbc_connection_read_partition()`
-#' return a [nanoarrow_array_stream][nanoarrow::as_nanoarrow_array_stream()].
+#' - `adbc_connection_get_info()`, `adbc_connection_get_objects()`,
+#' `adbc_connection_get_table_types()`, and `adbc_connection_read_partition()`
+#' return a [nanoarrow_array_stream][nanoarrow::as_nanoarrow_array_stream()].
#' - `adbc_connection_get_table_schema()` returns a
-#' [nanoarrow_schena][nanoarrow::as_nanoarrow_schema()]
+#' [nanoarrow_schena][nanoarrow::as_nanoarrow_schema()]
#' - `adbc_connection_commit()` and `adbc_connection_rollback()` return
-#' `connection`, invisibly.
+#' `connection`, invisibly.
#' @export
#'
#' @examples
diff --git a/r/adbcdrivermanager/README.Rmd b/r/adbcdrivermanager/README.Rmd
index 3907fce8..65d4e184 100644
--- a/r/adbcdrivermanager/README.Rmd
+++ b/r/adbcdrivermanager/README.Rmd
@@ -41,6 +41,12 @@ and support for user-facing packages that rely on ADBC drivers.
## Installation
+You can install the released version of adbcdrivermanager from [CRAN](https://cran.r-project.org/) with:
+
+```r
+install.packages("adbcdrivermanager")
+```
+
You can install the development version of adbcdrivermanager from [GitHub](https://github.com/) with:
``` r
diff --git a/r/adbcdrivermanager/README.md b/r/adbcdrivermanager/README.md
index 18b23a36..70da548b 100644
--- a/r/adbcdrivermanager/README.md
+++ b/r/adbcdrivermanager/README.md
@@ -29,6 +29,13 @@ rely on ADBC drivers.
## Installation
+You can install the released version of adbcdrivermanager from
+[CRAN](https://cran.r-project.org/) with:
+
+``` r
+install.packages("adbcdrivermanager")
+```
+
You can install the development version of adbcdrivermanager from
[GitHub](https://github.com/) with:
@@ -72,22 +79,22 @@ adbc_statement_execute_query(stmt, stream)
# Materialize the whole query as a tibble
tibble::as_tibble(stream)
#> # A tibble: 336,776 × 19
-#> year month day dep_time sched_de…¹ dep_d…² arr_t…³ sched…⁴ arr_d…⁵ carrier
-#> <int> <int> <int> <int> <int> <dbl> <int> <int> <dbl> <chr>
-#> 1 2013 1 1 517 515 2 830 819 11 UA
-#> 2 2013 1 1 533 529 4 850 830 20 UA
-#> 3 2013 1 1 542 540 2 923 850 33 AA
-#> 4 2013 1 1 544 545 -1 1004 1022 -18 B6
-#> 5 2013 1 1 554 600 -6 812 837 -25 DL
-#> 6 2013 1 1 554 558 -4 740 728 12 UA
-#> 7 2013 1 1 555 600 -5 913 854 19 B6
-#> 8 2013 1 1 557 600 -3 709 723 -14 EV
-#> 9 2013 1 1 557 600 -3 838 846 -8 B6
-#> 10 2013 1 1 558 600 -2 753 745 8 AA
-#> # … with 336,766 more rows, 9 more variables: flight <int>, tailnum <chr>,
-#> # origin <chr>, dest <chr>, air_time <dbl>, distance <dbl>, hour <dbl>,
-#> # minute <dbl>, time_hour <dttm>, and abbreviated variable names
-#> # ¹sched_dep_time, ²dep_delay, ³arr_time, ⁴sched_arr_time, ⁵arr_delay
+#> year month day dep_time sched_dep_time dep_delay arr_time sched_arr_time
+#> <int> <int> <int> <int> <int> <dbl> <int> <int>
+#> 1 2013 1 1 517 515 2 830 819
+#> 2 2013 1 1 533 529 4 850 830
+#> 3 2013 1 1 542 540 2 923 850
+#> 4 2013 1 1 544 545 -1 1004 1022
+#> 5 2013 1 1 554 600 -6 812 837
+#> 6 2013 1 1 554 558 -4 740 728
+#> 7 2013 1 1 555 600 -5 913 854
+#> 8 2013 1 1 557 600 -3 709 723
+#> 9 2013 1 1 557 600 -3 838 846
+#> 10 2013 1 1 558 600 -2 753 745
+#> # ℹ 336,766 more rows
+#> # ℹ 11 more variables: arr_delay <dbl>, carrier <chr>, flight <int>,
+#> # tailnum <chr>, origin <chr>, dest <chr>, air_time <dbl>, distance <dbl>,
+#> # hour <dbl>, minute <dbl>, time_hour <dttm>
# Clean up!
adbc_statement_release(stmt)
diff --git a/r/adbcdrivermanager/cran-comments.md b/r/adbcdrivermanager/cran-comments.md
new file mode 100644
index 00000000..e3b0ab85
--- /dev/null
+++ b/r/adbcdrivermanager/cran-comments.md
@@ -0,0 +1,6 @@
+
+## R CMD check results
+
+0 errors | 0 warnings | 1 note
+
+* This is a new release.
diff --git a/r/adbcdrivermanager/man/adbc_connection_get_info.Rd b/r/adbcdrivermanager/man/adbc_connection_get_info.Rd
index 3c3b679e..451a9b0f 100644
--- a/r/adbcdrivermanager/man/adbc_connection_get_info.Rd
+++ b/r/adbcdrivermanager/man/adbc_connection_get_info.Rd
@@ -35,25 +35,36 @@ adbc_connection_rollback(connection)
\arguments{
\item{connection}{An \link[=adbc_connection_init]{adbc_connection}}
-\item{info_codes}{(Currently undocumented)}
+\item{info_codes}{A list of metadata codes to fetch, or NULL to fetch all.
+Valid values are documented in the adbc.h header.}
-\item{depth}{(Currently undocumented)}
+\item{depth}{The level of nesting to display. If 0, display all levels. If 1,
+display only catalogs (i.e. catalog_schemas will be null). If 2, display
+only catalogs and schemas (i.e. db_schema_tables will be null), and so on.}
-\item{catalog}{(Currently undocumented)}
+\item{catalog}{Only show tables in the given catalog. If NULL, do not filter
+by catalog. If an empty string, only show tables without a catalog. May be
+a search pattern.}
-\item{db_schema}{(Currently undocumented)}
+\item{db_schema}{Only show tables in the given database schema. If NULL, do
+not filter by database schema. If an empty string, only show tables without
+a database schema. May be a search pattern.}
-\item{table_name}{(Currently undocumented)}
+\item{table_name}{Only show tables with the given name. If NULL, do not
+filter by name. May be a search pattern.}
-\item{table_type}{(Currently undocumented)}
+\item{table_type}{Only show tables matching one of the given table types. If
+NULL, show tables of any type. Valid table types can be fetched from
+GetTableTypes. Terminate the list with a NULL entry.}
-\item{column_name}{(Currently undocumented)}
+\item{column_name}{Only show columns with the given name. If NULL, do not
+filter by name. May be a search pattern.}
-\item{serialized_partition}{(Currently undocumented)}
+\item{serialized_partition}{The partition descriptor.}
}
\value{
\itemize{
-\item \code{adbc_connection_get_info()}, \code{adbc_connection_get_objects},
+\item \code{adbc_connection_get_info()}, \code{adbc_connection_get_objects()},
\code{adbc_connection_get_table_types()}, and \code{adbc_connection_read_partition()}
return a \link[nanoarrow:as_nanoarrow_array_stream]{nanoarrow_array_stream}.
\item \code{adbc_connection_get_table_schema()} returns a
diff --git a/r/adbcdrivermanager/man/adbcdrivermanager-package.Rd b/r/adbcdrivermanager/man/adbcdrivermanager-package.Rd
index c9c00a27..ddb83a14 100644
--- a/r/adbcdrivermanager/man/adbcdrivermanager-package.Rd
+++ b/r/adbcdrivermanager/man/adbcdrivermanager-package.Rd
@@ -4,9 +4,9 @@
\name{adbcdrivermanager-package}
\alias{adbcdrivermanager}
\alias{adbcdrivermanager-package}
-\title{adbcdrivermanager: Arrow Database Connectivity (ADBC) Driver Manager}
+\title{adbcdrivermanager: 'Arrow' Database Connectivity ('ADBC') Driver Manager}
\description{
-Provides a developer-facing interface to Arrow Database Connectivity (ADBC) for the purposes of driver development, driver testing, and building high-level database interfaces for users. ADBC is an API standard for database access libraries that uses Arrow for result sets and query parameters.
+Provides a developer-facing interface to 'Arrow' Database Connectivity ('ADBC') for the purposes of driver development, driver testing, and building high-level database interfaces for users. 'ADBC' is an API standard for database access libraries that uses 'Arrow' for result sets and query parameters.
}
\seealso{
Useful links:
@@ -24,5 +24,10 @@ Authors:
\item Apache Arrow \email{dev@arrow.apache.org} [copyright holder]
}
+Other contributors:
+\itemize{
+ \item Apache Software Foundation \email{dev@arrow.apache.org} [copyright holder]
+}
+
}
\keyword{internal}
diff --git a/r/adbcdrivermanager/src/error.cc b/r/adbcdrivermanager/src/error.cc
index c481a0f1..79f8aaa1 100644
--- a/r/adbcdrivermanager/src/error.cc
+++ b/r/adbcdrivermanager/src/error.cc
@@ -60,7 +60,9 @@ extern "C" SEXP RAdbcErrorProxy(SEXP error_xptr) {
UNPROTECT(1);
}
- SET_VECTOR_ELT(result, 1, Rf_ScalarInteger(error->vendor_code));
+ SEXP vendor_code = PROTECT(Rf_ScalarInteger(error->vendor_code));
+ SET_VECTOR_ELT(result, 1, vendor_code);
+ UNPROTECT(1);
SEXP sqlstate = PROTECT(Rf_allocVector(RAWSXP, sizeof(error->sqlstate)));
memcpy(RAW(sqlstate), error->sqlstate, sizeof(error->sqlstate));
diff --git a/r/adbcdrivermanager/src/radbc.cc b/r/adbcdrivermanager/src/radbc.cc
index a04fea86..92f8e31c 100644
--- a/r/adbcdrivermanager/src/radbc.cc
+++ b/r/adbcdrivermanager/src/radbc.cc
@@ -492,9 +492,14 @@ extern "C" SEXP RAdbcStatementExecuteQuery(SEXP statement_xptr, SEXP out_stream_
const char* names[] = {"status", "rows_affected", ""};
SEXP result = PROTECT(Rf_mkNamed(VECSXP, names));
- SET_VECTOR_ELT(result, 0, adbc_wrap_status(status));
- SET_VECTOR_ELT(result, 1, Rf_ScalarReal(rows_affected));
+
+ SEXP status_sexp = PROTECT(adbc_wrap_status(status));
+ SET_VECTOR_ELT(result, 0, status_sexp);
UNPROTECT(1);
+
+ SEXP rows_affected_sexp = PROTECT(Rf_ScalarReal(rows_affected));
+ SET_VECTOR_ELT(result, 1, rows_affected_sexp);
+ UNPROTECT(2);
return result;
}