Skip to content

Commit

Permalink
Adjustments for R CMD check under r-devel (#571)
Browse files Browse the repository at this point in the history
* Do not export Arrow internal helper functions (no need for Rd files)

* Unsure compilation of column buffer class is under no-deprecation

* Condition one more test to run under Windows

* Ensure search for pkg-config is not tripped up on Windows
  • Loading branch information
eddelbuettel authored Jul 16, 2023
1 parent 7022d65 commit 159253e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export("return_as<-")
export("selected_points<-")
export("selected_ranges<-")
export("strings_as_factors<-")
export(.as_arrow_table)
export(.check_arrow_pointers)
export(.tiledb_set_arrow_config)
export(.tiledb_unset_arrow_config)
export(allows_dups)
export(array_consolidate)
export(array_vacuum)
Expand Down
4 changes: 0 additions & 4 deletions R/ArrowIO.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,12 @@ tiledb_arrow_schema_del <- function(ptr) {
}

##' @noRd
##' @export
.check_arrow_pointers <- function(arrlst) {
stopifnot("First argument must be an external pointer to ArrowArray" = check_arrow_array_tag(arrlst[[1]]),
"Second argument must be an external pointer to ArrowSchema" = check_arrow_schema_tag(arrlst[[2]]))
}

##' @noRd
##' @export
.as_arrow_table <- function(arrlst) {
.check_arrow_pointers(arrlst)
if (!requireNamespace("arrow", quietly=TRUE)) {
Expand All @@ -104,7 +102,6 @@ tiledb_arrow_schema_del <- function(ptr) {
}

##' @noRd
##' @export
.tiledb_set_arrow_config <- function(ctx = tiledb_get_context()) {
cfg <- tiledb_config() # for var-num columns such as char we need these
cfg["sm.var_offsets.bitsize"] <- "64"
Expand All @@ -114,7 +111,6 @@ tiledb_arrow_schema_del <- function(ptr) {
}

##' @noRd
##' @export
.tiledb_unset_arrow_config <- function(ctx = tiledb_get_context()) {
cfg <- tiledb_config() # for var-num columns such as char we need these
cfg["sm.var_offsets.bitsize"] <- "64"
Expand Down
4 changes: 3 additions & 1 deletion R/Init.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ inlineCxxPlugin <- function(...) {
.set_compile_link_options <- function(cppflag, ldflag) {
if (missing(cppflag) && missing(ldflag)) {
pkgcfg <- unname(Sys.which("pkg-config"))
have_tiledb_pkgcfg <- isTRUE(pkgcfg != "" && system2(pkgcfg, c("tiledb", "--exists")) == 0)
have_tiledb_pkgcfg <- isTRUE(Sys.info()[["sysname"]] != "Windows" &&
pkgcfg != "" &&
system2(pkgcfg, c("tiledb", "--exists")) == 0)
if ((tiledb <- Sys.getenv("TILEDB_INSTALL_DIR", "")) != "") {
.pkgenv[["tiledb_cppflag"]] <- sprintf("-I%s/include", tiledb)
.pkgenv[["tiledb_ldflag"]] <- sprintf("-L%s -ltiledb", tiledb)
Expand Down
3 changes: 2 additions & 1 deletion inst/tinytest/test_querycondition.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ library(tinytest)
library(tiledb)

isOldWindows <- Sys.info()[["sysname"]] == "Windows" && grepl('Windows Server 2008', osVersion)
isWindows <- Sys.info()[["sysname"]] == "Windows"
if (isOldWindows) exit_file("skip this file on old Windows releases")

#if (Sys.getenv("_RUNNING_UNDER_VALGRIND_", "FALSE") == "TRUE" && Sys.Date() < as.Date("2022-08-06")) exit_file("Skipping under valgrind until Aug 6")
Expand Down Expand Up @@ -441,4 +442,4 @@ fromDataFrame(D, uri)
arr <- tiledb_array(uri, extended=FALSE, return_as="data.frame")
qc <- parse_query_condition(datetime > "2023-01-05 00:00:00" && date <= "2023-01-10", ta=arr)
query_condition(arr) <- qc
expect_equal(nrow(arr[]), 5)
if (!isWindows) expect_equal(nrow(arr[]), 5)
6 changes: 6 additions & 0 deletions src/column_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
* This file defines the a ColumBuffer class.
*/

// compilation is noisy with the deprecation, we cannot use -Wno-deprecated-declarations
// as CRAN flags it as a non-portable compiler option, and we cannot (easily) remove the
// code (yet) so silencing it is for now, and regrouping the affected routines here which
// also minimizes the surface of code covered by this definition
#define TILEDB_DEPRECATED

#include "tinyspdl.h"
#include "column_buffer.h"

Expand Down

0 comments on commit 159253e

Please sign in to comment.