r-arrow: use metadata checks

This commit is contained in:
Pekka Ristola 2024-02-14 13:48:55 +02:00
parent 33f5eaf9d3
commit dea89c053f
No known key found for this signature in database
GPG key ID: 2C20BE716E05213E
4 changed files with 151 additions and 27 deletions

View file

@ -1,21 +1,19 @@
# system requirements: C++11; for AWS S3 support on Linux, libcurl andopenssl (optional)
# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net>
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Contributor: Guoyi Zhang <guoyizhang at malacology dot net>
_pkgname=arrow
_pkgver=14.0.0.2
pkgname=r-${_pkgname,,}
pkgver=14.0.0.2
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="Integration to 'Apache' 'Arrow'"
arch=('x86_64')
url="https://cran.r-project.org/package=${_pkgname}"
license=('Apache')
arch=(x86_64)
url="https://cran.r-project.org/package=$_pkgname"
license=(Apache)
depends=(
r
arrow
r-assertthat
r-bit64
r-cpp11
r-glue
r-purrr
r-r6
@ -23,11 +21,23 @@ depends=(
r-tidyselect
r-vctrs
)
makedepends=(
r-cpp11
)
checkdepends=(
r-blob
r-curl
r-dplyr
r-hms
r-lubridate
r-reticulate
r-stringr
r-testthat
)
optdepends=(
libcurl-compat
openssl
r-blob
r-cli
r-curl
r-dbi
r-dbplyr
r-decor
@ -50,15 +60,29 @@ optdepends=(
r-tzdb
r-withr
)
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
sha256sums=('7138a52d66f1b94ec31c25e8929d6f92b1640df852a10817600a82ab68ba8ab7')
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz"
"fix-build.patch")
md5sums=('84cefe34da6af43984b308ca2a57d7bd'
'3c7ea1780d1a7eff30d0243e161534ce')
b2sums=('5d234175981bde6b094593856e8286048ca05308eb00d591c96a68826e43e78c2cf8d594316c50946b374e6e872ff065aeb191c36d0ba0b1104f31cc94ae6102'
'1926311b6ec30259adcfcfa94cfff8cbe55bf3a87c324112fba5e601bd1daa404efd79e7b78a21eb72982686e12614f33c17421a59cc07858734d58676edd70c')
prepare() {
# fix build with system arrow, skip failing tests
patch -Np1 -i fix-build.patch
}
build() {
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}"
mkdir build
R CMD INSTALL -l build "$_pkgname"
}
check() {
cd "$_pkgname/tests"
R_LIBS="$srcdir/build" NOT_CRAN=true Rscript --vanilla testthat.R
}
package() {
install -dm0755 "${pkgdir}/usr/lib/R/library"
cp -a --no-preserve=ownership "${_pkgname}" "${pkgdir}/usr/lib/R/library"
install -d "$pkgdir/usr/lib/R/library"
cp -a --no-preserve=ownership "build/$_pkgname" "$pkgdir/usr/lib/R/library"
}
# vim:set ts=2 sw=2 et:

View file

@ -0,0 +1,66 @@
diff --git a/arrow/src/r_to_arrow.cpp b/arrow/src/r_to_arrow.cpp
index 19c2397..d9bf848 100644
--- a/arrow/src/r_to_arrow.cpp
+++ b/arrow/src/r_to_arrow.cpp
@@ -1051,10 +1051,15 @@ struct RConverterTrait;
template <typename T>
struct RConverterTrait<
T, enable_if_t<!is_nested_type<T>::value && !is_interval_type<T>::value &&
- !is_extension_type<T>::value>> {
+ !is_extension_type<T>::value && !is_binary_view_like_type<T>::value>> {
using type = RPrimitiveConverter<T>;
};
+template <typename T>
+struct RConverterTrait<T, enable_if_binary_view_like<T>> {
+ // not implemented
+};
+
template <typename T>
struct RConverterTrait<T, enable_if_list_like<T>> {
using type = RListConverter<T>;
diff --git a/arrow/tests/testthat/test-dplyr-filter.R b/arrow/tests/testthat/test-dplyr-filter.R
index 724b93c..dccc41a 100644
--- a/arrow/tests/testthat/test-dplyr-filter.R
+++ b/arrow/tests/testthat/test-dplyr-filter.R
@@ -288,6 +288,7 @@ test_that("filter environment scope", {
})
test_that("Filtering on a column that doesn't exist errors correctly", {
+ skip("requires French locale")
with_language("fr", {
# expect_warning(., NA) because the usual behavior when it hits a filter
# that it can't evaluate is to raise a warning, collect() to R, and retry
diff --git a/arrow/tests/testthat/test-dplyr-mutate.R b/arrow/tests/testthat/test-dplyr-mutate.R
index 0889fff..7e507ff 100644
--- a/arrow/tests/testthat/test-dplyr-mutate.R
+++ b/arrow/tests/testthat/test-dplyr-mutate.R
@@ -514,6 +514,7 @@ test_that("Can't supply .by after group_by", {
})
test_that("handle bad expressions", {
+ skip("requires French locale")
# TODO: search for functions other than mean() (see above test)
# that need to be forced to fail because they error ambiguously
diff --git a/arrow/tools/check-versions.R b/arrow/tools/check-versions.R
index 3d8cbf0..920a7ef 100644
--- a/arrow/tools/check-versions.R
+++ b/arrow/tools/check-versions.R
@@ -49,16 +49,6 @@ check_versions <- function(r_version, cpp_version) {
r_version
)
)
- } else if (r_version != cpp_version) {
- cat(
- sprintf(
- "**** Not using: C++ library version (%s) does not match R package (%s)\n",
- cpp_version,
- r_version
- )
- )
- stop("version mismatch")
- # Add ALLOW_VERSION_MISMATCH env var to override stop()? (Could be useful for debugging)
} else {
# OK
cat(sprintf("**** C++ and R library versions match: %s\n", cpp_version))

View file

@ -1,12 +1,16 @@
#!/usr/bin/env python3
from lilaclib import *
import os
import sys
sys.path.append(os.path.normpath(f'{__file__}/../../../lilac-extensions'))
from lilac_r_utils import r_pre_build
def pre_build():
for line in edit_file('PKGBUILD'):
if line.startswith('_pkgver='):
line = f'_pkgver={_G.newver}'
print(line)
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
r_pre_build(
_G,
expect_systemrequirements = "C++17; for AWS S3 support on Linux, libcurl and openssl (optional)",
)
def post_build():
git_pkgbuild_commit()

View file

@ -1,19 +1,49 @@
build_prefix: extra-x86_64
maintainers:
- github: starsareintherose
email: kuoi@bioarchlinux.org
- github: pekkarr
email: pekkarr@protonmail.com
repo_depends:
- r-assertthat
- r-bit64
- r-cpp11
- r-glue
- r-purrr
- r-r6
- r-rlang
- r-tidyselect
- r-vctrs
repo_makedepends:
- r-cpp11
- r-blob
- r-curl
- r-dplyr
- r-hms
- r-lubridate
- r-reticulate
- r-stringr
- r-testthat
update_on:
- regex: arrow_([\d._-]+).tar.gz
source: regex
url: https://cran.r-project.org/package=arrow
- source: rpkgs
pkgname: arrow
repo: cran
md5: true
- alias: r
- source: alpmfiles
pkgname: arrow
filename: usr/lib/libarrow\.so\.([^.]+)
repo: extra
- source: alpmfiles
pkgname: arrow
filename: usr/lib/libarrow_acero\.so\.([^.]+)
repo: extra
- source: alpmfiles
pkgname: arrow
filename: usr/lib/libarrow_dataset\.so\.([^.]+)
repo: extra
- source: alpmfiles
pkgname: arrow
filename: usr/lib/libarrow_substrait\.so\.([^.]+)
repo: extra
- source: alpmfiles
pkgname: arrow
filename: usr/lib/libparquet\.so\.([^.]+)
repo: extra