You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by th...@apache.org on 2026/08/21 08:20:47 UTC
(arrow) branch maint-25.0.1-r updated (beccec0d0c -> 64e1b80aea)
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a change to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
from beccec0d0c MINOR: [Release] Update versions for 25.0.1
new cecf599faf Remove badges
new d1fb01549e Update NEWS
new df0fca684d MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake (#50317)
new a9f512d662 GH-50339: [R] read_ipc_stream fails to unify nested uint64 fields inside a Struct array across record batches (#50374)
new a518a81e69 GH-50495: [R] 25.0.0 Release followups (#50786)
new 64e1b80aea Reove duplication from NEWS
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
r/NAMESPACE | 2 -
r/NEWS.md | 45 +++++++++++++-
r/R/arrow-info.R | 6 --
r/R/dataset-format.R | 1 -
r/R/dplyr-funcs-doc.R | 34 +++++------
r/R/filesystem.R | 121 +++++++++++++++++++++++++++++++++++++
r/R/type.R | 23 +++----
r/README.md | 8 ---
r/data-raw/docgen.R | 8 ++-
r/man/FileSystem.Rd | 35 +++++++++++
r/man/acero.Rd | 36 +++++------
r/man/arrow_info.Rd | 3 -
r/man/data-type.Rd | 15 ++---
r/man/infer_type.Rd | 5 +-
r/src/array_to_vector.cpp | 9 +--
r/src/arrowExports.cpp | 44 +++++++-------
r/src/type_infer.cpp | 2 +-
r/tests/testthat/test-Array.R | 27 ++++++---
r/tests/testthat/test-arrow-info.R | 4 --
r/tests/testthat/test-type.R | 9 ---
r/tools/nixlibs.R | 3 +-
r/vignettes/data_types.Rmd | 15 +++--
22 files changed, 315 insertions(+), 140 deletions(-)
(arrow) 04/06: GH-50339: [R] read_ipc_stream fails to unify nested uint64 fields inside a Struct array across record batches (#50374)
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a commit to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit a9f512d662e59eabe46bad5c3c5ee41e456cf38c
Author: Nic Crane <th...@gmail.com>
AuthorDate: Thu Jul 9 12:32:33 2026 +0100
GH-50339: [R] read_ipc_stream fails to unify nested uint64 fields inside a Struct array across record batches (#50374)
### Rationale for this change
Attempting downcasting on UINT64 Fields when converting them from Arrow to R works fine on individual arrays, but fails on list arrays, because we only use the individual row to work out whether to downcast.
I considered a few different solutions but I concluded that this one is the least complex while presenting a good solution - having UINT64 always be converted to doubles and never attempt downcasting.
The impact here is that people who are expecting integers via downcasting will see a change in behaviour, but I think there's a strong argument here that if you are using UINT64 to store values that can be downcast, you probably need to be using UINT32 anyway.
Other options considered: fix this in `Converter_List` and check values to see if they can be downcast: significantly more complex and only fixes one level of nesting.
I checked duckdb and they always convert UINT64 to doubles.
### What changes are included in this PR?
Never try to downcast UNIT64 values when converting to R
### Are these changes tested?
Yes
### Are there any user-facing changes?
Breaking change as mentioned in rationale above.
* GitHub Issue: #50339
Lead-authored-by: Nic Crane <th...@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <17...@users.noreply.github.com>
Signed-off-by: Nic Crane <th...@gmail.com>
---
r/NEWS.md | 4 ++++
r/R/type.R | 15 ++++++++-------
r/man/data-type.Rd | 15 ++++++++-------
r/src/array_to_vector.cpp | 9 ++-------
r/src/arrowExports.cpp | 44 +++++++++++++++++++++----------------------
r/tests/testthat/test-Array.R | 27 +++++++++++++++++++-------
r/vignettes/data_types.Rmd | 15 +++++++++------
7 files changed, 73 insertions(+), 56 deletions(-)
diff --git a/r/NEWS.md b/r/NEWS.md
index 19072423d1..543f5c27b2 100644
--- a/r/NEWS.md
+++ b/r/NEWS.md
@@ -63,6 +63,10 @@
## Installation
- The R package now builds under `r-universe/r-wasm` (#49981).
+- Arrow `uint64` types are now always converted to R `double` (numeric) vectors,
+ regardless of the values. Previously, small `uint64` values were converted to
+ R `integer`, which could cause inconsistent types within list columns when
+ different list elements had different value ranges (#50339).
# arrow 24.0.0
diff --git a/r/R/type.R b/r/R/type.R
index 27cb0afe3d..14a4c8f1d2 100644
--- a/r/R/type.R
+++ b/r/R/type.R
@@ -356,13 +356,14 @@ NestedType <- R6Class("NestedType", inherit = DataType)
#' `date32()` creates a datetime type with a "day" unit, like the R `Date`
#' class. `date64()` has a "ms" unit.
#'
-#' `uint32` (32 bit unsigned integer), `uint64` (64 bit unsigned integer), and
-#' `int64` (64-bit signed integer) types may contain values that exceed the
-#' range of R's `integer` type (32-bit signed integer). When these arrow objects
-#' are translated to R objects, `uint32` and `uint64` are converted to `double`
-#' ("numeric") and `int64` is converted to `bit64::integer64`. For `int64`
-#' types, this conversion can be disabled (so that `int64` always yields a
-#' `bit64::integer64` object) by setting `options(arrow.int64_downcast =
+#' `uint64` (64 bit unsigned integer) is always converted to `double`
+#' ("numeric") in R. Note that doubles cannot exactly represent all uint64
+#' values; precision may be lost for values above 2^53. `uint32` (32 bit unsigned integer) and `int64` (64-bit
+#' signed integer) types may contain values that exceed the range of R's
+#' `integer` type (32-bit signed integer). When they do, `uint32` is converted
+#' to `double` ("numeric") and `int64` is converted to `bit64::integer64`. For
+#' `int64` types, this conversion can be disabled (so that `int64` always yields
+#' a `bit64::integer64` object) by setting `options(arrow.int64_downcast =
#' FALSE)`.
#'
#' `decimal128()` creates a `Decimal128Type`. Arrow decimals are fixed-point
diff --git a/r/man/data-type.Rd b/r/man/data-type.Rd
index aa11c222bc..29fb667ed6 100644
--- a/r/man/data-type.Rd
+++ b/r/man/data-type.Rd
@@ -171,13 +171,14 @@ A few functions have aliases:
\code{date32()} creates a datetime type with a "day" unit, like the R \code{Date}
class. \code{date64()} has a "ms" unit.
-\code{uint32} (32 bit unsigned integer), \code{uint64} (64 bit unsigned integer), and
-\code{int64} (64-bit signed integer) types may contain values that exceed the
-range of R's \code{integer} type (32-bit signed integer). When these arrow objects
-are translated to R objects, \code{uint32} and \code{uint64} are converted to \code{double}
-("numeric") and \code{int64} is converted to \code{bit64::integer64}. For \code{int64}
-types, this conversion can be disabled (so that \code{int64} always yields a
-\code{bit64::integer64} object) by setting \code{options(arrow.int64_downcast = FALSE)}.
+\code{uint64} (64 bit unsigned integer) is always converted to \code{double}
+("numeric") in R. Note that doubles cannot exactly represent all uint64
+values; precision may be lost for values above 2^53. \code{uint32} (32 bit unsigned integer) and \code{int64} (64-bit
+signed integer) types may contain values that exceed the range of R's
+\code{integer} type (32-bit signed integer). When they do, \code{uint32} is converted
+to \code{double} ("numeric") and \code{int64} is converted to \code{bit64::integer64}. For
+\code{int64} types, this conversion can be disabled (so that \code{int64} always yields
+a \code{bit64::integer64} object) by setting \code{options(arrow.int64_downcast = FALSE)}.
\code{decimal128()} creates a \code{Decimal128Type}. Arrow decimals are fixed-point
decimal numbers encoded as a scalar integer. The \code{precision} is the number of
diff --git a/r/src/array_to_vector.cpp b/r/src/array_to_vector.cpp
index 0992181acf..dc02c711d1 100644
--- a/r/src/array_to_vector.cpp
+++ b/r/src/array_to_vector.cpp
@@ -1296,13 +1296,8 @@ std::shared_ptr<Converter> Converter::Make(
}
case Type::UINT64:
- if (ArraysCanFitInteger(chunked_array->chunks())) {
- return std::make_shared<arrow::r::Converter_Int<arrow::UInt64Type>>(
- chunked_array);
- } else {
- return std::make_shared<arrow::r::Converter_Double<arrow::UInt64Type>>(
- chunked_array);
- }
+ return std::make_shared<arrow::r::Converter_Double<arrow::UInt64Type>>(
+ chunked_array);
case Type::HALF_FLOAT:
return std::make_shared<arrow::r::Converter_Double<arrow::HalfFloatType>>(
diff --git a/r/src/arrowExports.cpp b/r/src/arrowExports.cpp
index 5482c8679f..8a67d0acd8 100644
--- a/r/src/arrowExports.cpp
+++ b/r/src/arrowExports.cpp
@@ -3238,22 +3238,6 @@ BEGIN_CPP11
END_CPP11
}
// field.cpp
-bool Field__nullable(const std::shared_ptr<arrow::Field>& field);
-extern "C" SEXP _arrow_Field__nullable(SEXP field_sexp){
-BEGIN_CPP11
- arrow::r::Input<const std::shared_ptr<arrow::Field>&>::type field(field_sexp);
- return cpp11::as_sexp(Field__nullable(field));
-END_CPP11
-}
-// field.cpp
-std::shared_ptr<arrow::DataType> Field__type(const std::shared_ptr<arrow::Field>& field);
-extern "C" SEXP _arrow_Field__type(SEXP field_sexp){
-BEGIN_CPP11
- arrow::r::Input<const std::shared_ptr<arrow::Field>&>::type field(field_sexp);
- return cpp11::as_sexp(Field__type(field));
-END_CPP11
-}
-// field.cpp
bool Field__HasMetadata(const std::shared_ptr<arrow::Field>& field);
extern "C" SEXP _arrow_Field__HasMetadata(SEXP field_sexp){
BEGIN_CPP11
@@ -3286,6 +3270,22 @@ BEGIN_CPP11
return cpp11::as_sexp(Field__RemoveMetadata(field));
END_CPP11
}
+// field.cpp
+bool Field__nullable(const std::shared_ptr<arrow::Field>& field);
+extern "C" SEXP _arrow_Field__nullable(SEXP field_sexp){
+BEGIN_CPP11
+ arrow::r::Input<const std::shared_ptr<arrow::Field>&>::type field(field_sexp);
+ return cpp11::as_sexp(Field__nullable(field));
+END_CPP11
+}
+// field.cpp
+std::shared_ptr<arrow::DataType> Field__type(const std::shared_ptr<arrow::Field>& field);
+extern "C" SEXP _arrow_Field__type(SEXP field_sexp){
+BEGIN_CPP11
+ arrow::r::Input<const std::shared_ptr<arrow::Field>&>::type field(field_sexp);
+ return cpp11::as_sexp(Field__type(field));
+END_CPP11
+}
// filesystem.cpp
fs::FileType fs___FileInfo__type(const std::shared_ptr<fs::FileInfo>& x);
extern "C" SEXP _arrow_fs___FileInfo__type(SEXP x_sexp){
@@ -5878,10 +5878,10 @@ static const R_CallMethodDef CallEntries[] = {
{ "_arrow_compute__GetFunctionNames", (DL_FUNC) &_arrow_compute__GetFunctionNames, 0},
{ "_arrow_compute__Initialize", (DL_FUNC) &_arrow_compute__Initialize, 0},
{ "_arrow_RegisterScalarUDF", (DL_FUNC) &_arrow_RegisterScalarUDF, 2},
- { "_arrow_build_info", (DL_FUNC) &_arrow_build_info, 0},
- { "_arrow_runtime_info", (DL_FUNC) &_arrow_runtime_info, 0},
- { "_arrow_set_timezone_database", (DL_FUNC) &_arrow_set_timezone_database, 1},
- { "_arrow_csv___WriteOptions__initialize", (DL_FUNC) &_arrow_csv___WriteOptions__initialize, 1},
+ { "_arrow_build_info", (DL_FUNC) &_arrow_build_info, 0},
+ { "_arrow_runtime_info", (DL_FUNC) &_arrow_runtime_info, 0},
+ { "_arrow_set_timezone_database", (DL_FUNC) &_arrow_set_timezone_database, 1},
+ { "_arrow_csv___WriteOptions__initialize", (DL_FUNC) &_arrow_csv___WriteOptions__initialize, 1},
{ "_arrow_csv___ReadOptions__initialize", (DL_FUNC) &_arrow_csv___ReadOptions__initialize, 1},
{ "_arrow_csv___ParseOptions__initialize", (DL_FUNC) &_arrow_csv___ParseOptions__initialize, 1},
{ "_arrow_csv___ReadOptions__column_names", (DL_FUNC) &_arrow_csv___ReadOptions__column_names, 1},
@@ -6054,12 +6054,12 @@ static const R_CallMethodDef CallEntries[] = {
{ "_arrow_Field__ToString", (DL_FUNC) &_arrow_Field__ToString, 1},
{ "_arrow_Field__name", (DL_FUNC) &_arrow_Field__name, 1},
{ "_arrow_Field__Equals", (DL_FUNC) &_arrow_Field__Equals, 3},
- { "_arrow_Field__nullable", (DL_FUNC) &_arrow_Field__nullable, 1},
- { "_arrow_Field__type", (DL_FUNC) &_arrow_Field__type, 1},
{ "_arrow_Field__HasMetadata", (DL_FUNC) &_arrow_Field__HasMetadata, 1},
{ "_arrow_Field__metadata", (DL_FUNC) &_arrow_Field__metadata, 1},
{ "_arrow_Field__WithMetadata", (DL_FUNC) &_arrow_Field__WithMetadata, 2},
{ "_arrow_Field__RemoveMetadata", (DL_FUNC) &_arrow_Field__RemoveMetadata, 1},
+ { "_arrow_Field__nullable", (DL_FUNC) &_arrow_Field__nullable, 1},
+ { "_arrow_Field__type", (DL_FUNC) &_arrow_Field__type, 1},
{ "_arrow_fs___FileInfo__type", (DL_FUNC) &_arrow_fs___FileInfo__type, 1},
{ "_arrow_fs___FileInfo__set_type", (DL_FUNC) &_arrow_fs___FileInfo__set_type, 2},
{ "_arrow_fs___FileInfo__path", (DL_FUNC) &_arrow_fs___FileInfo__path, 1},
diff --git a/r/tests/testthat/test-Array.R b/r/tests/testthat/test-Array.R
index 9fcc3e6b86..b5233eb303 100644
--- a/r/tests/testthat/test-Array.R
+++ b/r/tests/testthat/test-Array.R
@@ -521,23 +521,25 @@ test_that("Array<int8>$as_vector() converts to integer (ARROW-3794)", {
expect_as_vector(a, u8)
})
-test_that("Arrays of {,u}int{32,64} convert to integer if they can fit", {
+test_that("Arrays of uint32 and int64 convert to integer if they can fit", {
u32 <- arrow_array(1L)$cast(uint32())
expect_identical(as.vector(u32), 1L)
- u64 <- arrow_array(1L)$cast(uint64())
- expect_identical(as.vector(u64), 1L)
-
i64 <- arrow_array(bit64::as.integer64(1:10))
expect_identical(as.vector(i64), 1:10)
})
-test_that("Arrays of uint{32,64} convert to numeric if they can't fit integer", {
+test_that("Arrays of uint32 convert to numeric if they can't fit integer", {
u32 <- arrow_array(bit64::as.integer64(1) + MAX_INT)$cast(uint32())
expect_identical(as.vector(u32), 1 + MAX_INT)
+})
- u64 <- arrow_array(bit64::as.integer64(1) + MAX_INT)$cast(uint64())
- expect_identical(as.vector(u64), 1 + MAX_INT)
+test_that("Arrays of uint64 always convert to numeric (double)", {
+ u64_small <- arrow_array(1L)$cast(uint64())
+ expect_identical(as.vector(u64_small), 1)
+
+ u64_large <- arrow_array(bit64::as.integer64(1) + MAX_INT)$cast(uint64())
+ expect_identical(as.vector(u64_large), 1 + MAX_INT)
})
test_that("arrow_array() recognise arrow::Array (ARROW-3815)", {
@@ -1453,3 +1455,14 @@ test_that("Array handles negative fractional dates correctly (GH-46873)", {
arr <- arrow_array(d)
expect_equal(as.vector(arr), as.Date("1969-12-31", origin = "1970-01-01"))
})
+
+test_that("uint64 inside list columns always converts to double (GH-50339)", {
+ list_arr <- arrow_array(
+ list(1, 9999999999),
+ type = list_of(uint64())
+ )
+
+ result <- as.vector(list_arr)
+ expect_type(result[[1]], "double")
+ expect_type(result[[2]], "double")
+})
diff --git a/r/vignettes/data_types.Rmd b/r/vignettes/data_types.Rmd
index d5c70a8f02..e22830f83f 100644
--- a/r/vignettes/data_types.Rmd
+++ b/r/vignettes/data_types.Rmd
@@ -97,12 +97,15 @@ If the value in R does not fall within the permissible range for the correspondi
chunked_array(c(10L, 3L, 200L), type = int8())
```
-When translating from Arrow to R, integer types alway translate to R integers unless one of the following exceptions applies:
+When translating from Arrow to R, integer types always translate to R integers unless one of the following exceptions applies:
-- If the value of an Arrow uint32 or uint64 falls outside the range allowed for R integers, the result will be a numeric vector in R
+- If the value of an Arrow uint32 falls outside the range allowed for R integers, the result will be a numeric vector in R
- If the value of an Arrow int64 variable falls outside the range allowed for R integers, the result will be a `bit64::integer64` vector in R
- If the user sets `options(arrow.int64_downcast = FALSE)`, the Arrow int64 type always yields a `bit64::integer64` vector in R
regardless of the value
+ - Arrow uint64 types are always converted to numeric (double) vectors in R.
+ Note that doubles cannot exactly represent all uint64 values; precision may
+ be lost for values above 2^53.
## Floating point numeric types
@@ -351,7 +354,7 @@ to Arrow list type (which is a "list of" some type).
| uint8 | integer |
| uint16 | integer |
| uint32 | integer ^1^ |
-| uint64 | integer ^1^ |
+| uint64 | double |
| float16 | - ^2^ |
| float32 | double |
| float64 | double |
@@ -376,9 +379,9 @@ to Arrow list type (which is a "list of" some type).
| map | arrow_list ^5^ |
| union | - ^2^ |
-^1^: These integer types may contain values that exceed the range of R's
-`integer` type (32 bit signed integer). When they do, `uint32` and `uint64` are
-converted to `double` ("numeric") and `int64` is converted to
+^1^: These integer types may contain values that exceed the range of R's
+`integer` type (32 bit signed integer). When they do, `uint32` is
+converted to `double` ("numeric") and `int64` is converted to
`bit64::integer64`. This conversion can be disabled (so that `int64` always
yields a `bit64::integer64` vector) by setting `options(arrow.int64_downcast = FALSE)`.
(arrow) 02/06: Update NEWS
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a commit to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit d1fb01549e1b632d6b387d990bf610fbb6ca401a
Author: Nic Crane <th...@gmail.com>
AuthorDate: Fri Aug 21 09:15:52 2026 +0100
Update NEWS
---
r/NEWS.md | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/r/NEWS.md b/r/NEWS.md
index 6ad6b038de..19072423d1 100644
--- a/r/NEWS.md
+++ b/r/NEWS.md
@@ -19,7 +19,50 @@
# arrow 25.0.1
-# arrow 24.0.0
+## Minor improvements and fixes
+
+- Improved mimalloc memory allocator configuration on macOS (#50428).
+
+# arrow 25.0.0
+
+## Breaking changes
+
+- Arrow `uint64` types are now always converted to R `double` (numeric) vectors,
+ regardless of the values. Previously, small `uint64` values were converted to
+ R `integer`, which could cause inconsistent types within list-columns when
+ different list elements had different value ranges (#50339).
+
+## New features
+
+- `Field` objects now support field-level metadata via `$metadata` and
+ `$with_metadata()` (@max-romagnoli, #33390).
+- Parquet files now support list-columns of ordered factors (ordered
+ dictionaries) (#49689).
+
+## Minor improvements and fixes
+
+- `Array$create()` now gives a clearer error message when given a `POSIXct`
+ object with an invalid timezone (#40886).
+- Dictionary arrays with `large_string` value types now convert correctly to R
+ factors (#39603).
+- `open_dataset()` now gives a clearer error message when providing a mix of
+ `readr` and Arrow options (@Rich-T-kid, #33420).
+- `read_parquet()` no longer triggers a C++ alignment warning from the Acero
+ source node (#46178).
+- `Schema` metadata partial matching on `$metadata$r` no longer errors when
+ other metadata keys start with "r" (#50163).
+- `to_arrow()` now preserves `group_by()` when converting from a dbplyr lazy
+ table (#40640).
+- `write_parquet()` now correctly validates that `max_rows_per_group` is a
+ positive number (#40742).
+- Stale S3 connections no longer cause a segfault during garbage collection
+ (#50009).
+- Spurious warnings are no longer emitted when reading files with custom schema
+ metadata (#48712).
+
+## Installation
+
+- The R package now builds under `r-universe/r-wasm` (#49981).
# arrow 24.0.0
(arrow) 01/06: Remove badges
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a commit to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit cecf599faf5d917bcc5c5574f74bb5d508a45cb1
Author: Nic Crane <th...@gmail.com>
AuthorDate: Fri Aug 21 09:06:00 2026 +0100
Remove badges
---
r/README.md | 8 --------
1 file changed, 8 deletions(-)
diff --git a/r/README.md b/r/README.md
index 268ee24bdf..d296143d27 100644
--- a/r/README.md
+++ b/r/README.md
@@ -1,13 +1,5 @@
# arrow <img src="https://arrow.apache.org/img/arrow-logo_hex_black-txt_white-bg.png" align="right" alt="" width="120" />
-<!-- badges: start -->
-
-[](https://cran.r-project.org/package=arrow)
-[](https://github.com/apache/arrow/actions/workflows/r.yml?query=branch%3Amain+event%3Apush)
-[](https://apache.r-universe.dev)
-[](https://anaconda.org/conda-forge/r-arrow)
-
-<!-- badges: end -->
## Overview
(arrow) 06/06: Reove duplication from NEWS
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a commit to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit 64e1b80aea8bff885a434dece00f77bc8727b805
Author: Nic Crane <th...@gmail.com>
AuthorDate: Fri Aug 21 09:20:24 2026 +0100
Reove duplication from NEWS
---
r/NEWS.md | 4 ----
1 file changed, 4 deletions(-)
diff --git a/r/NEWS.md b/r/NEWS.md
index 543f5c27b2..19072423d1 100644
--- a/r/NEWS.md
+++ b/r/NEWS.md
@@ -63,10 +63,6 @@
## Installation
- The R package now builds under `r-universe/r-wasm` (#49981).
-- Arrow `uint64` types are now always converted to R `double` (numeric) vectors,
- regardless of the values. Previously, small `uint64` values were converted to
- R `integer`, which could cause inconsistent types within list columns when
- different list elements had different value ranges (#50339).
# arrow 24.0.0
(arrow) 05/06: GH-50495: [R] 25.0.0 Release followups (#50786)
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a commit to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit a518a81e694508136782b94888c40c055957f695
Author: Nic Crane <th...@gmail.com>
AuthorDate: Mon Aug 3 13:51:43 2026 -0400
GH-50495: [R] 25.0.0 Release followups (#50786)
Changes from release branch need porting to main
Port them to main
No
Sure, we removed two defunct funcs
* GitHub Issue: #50495
Authored-by: Nic Crane <th...@gmail.com>
Signed-off-by: Nic Crane <th...@gmail.com>
---
r/NAMESPACE | 2 -
r/R/arrow-info.R | 6 --
r/R/dataset-format.R | 1 -
r/R/dplyr-funcs-doc.R | 34 +++++------
r/R/filesystem.R | 121 +++++++++++++++++++++++++++++++++++++
r/R/type.R | 8 ---
r/data-raw/docgen.R | 8 ++-
r/man/FileSystem.Rd | 35 +++++++++++
r/man/acero.Rd | 36 +++++------
r/man/arrow_info.Rd | 3 -
r/man/infer_type.Rd | 5 +-
r/src/type_infer.cpp | 2 +-
r/tests/testthat/test-arrow-info.R | 4 --
r/tests/testthat/test-type.R | 9 ---
14 files changed, 200 insertions(+), 74 deletions(-)
diff --git a/r/NAMESPACE b/r/NAMESPACE
index f74034c965..f3e0b1a0dc 100644
--- a/r/NAMESPACE
+++ b/r/NAMESPACE
@@ -278,7 +278,6 @@ export(Type)
export(UnionDataset)
export(all_of)
export(arrow_array)
-export(arrow_available)
export(arrow_info)
export(arrow_table)
export(arrow_with_acero)
@@ -403,7 +402,6 @@ export(time64)
export(timestamp)
export(to_arrow)
export(to_duckdb)
-export(type)
export(uint16)
export(uint32)
export(uint64)
diff --git a/r/R/arrow-info.R b/r/R/arrow-info.R
index 699f94dcbd..38ff09127a 100644
--- a/r/R/arrow-info.R
+++ b/r/R/arrow-info.R
@@ -73,12 +73,6 @@ arrow_info <- function() {
structure(out, class = "arrow_info")
}
-#' @rdname arrow_info
-#' @export
-arrow_available <- function() {
- .Deprecated(msg = "Arrow C++ is always available as of 7.0.0")
- TRUE
-}
#' @rdname arrow_info
#' @export
diff --git a/r/R/dataset-format.R b/r/R/dataset-format.R
index 60ede3553a..7a230aaa75 100644
--- a/r/R/dataset-format.R
+++ b/r/R/dataset-format.R
@@ -142,7 +142,6 @@ IpcFileFormat <- R6Class("IpcFileFormat", inherit = FileFormat)
#' @rdname JsonFileFormat
#' @name JsonFileFormat
#' @seealso [FileFormat]
-#' @examplesIf arrow_with_dataset()
#'
#' @export
JsonFileFormat <- R6Class("JsonFileFormat", inherit = FileFormat)
diff --git a/r/R/dplyr-funcs-doc.R b/r/R/dplyr-funcs-doc.R
index 2f5bbc11b6..1adf23fba1 100644
--- a/r/R/dplyr-funcs-doc.R
+++ b/r/R/dplyr-funcs-doc.R
@@ -100,24 +100,24 @@
#'
#' ## base
#'
-#' * [`!`][!()]
-#' * [`!=`][!=()]
-#' * [`%%`][%%()]
-#' * [`%/%`][%/%()]
-#' * [`%in%`][%in%()]
-#' * [`&`][&()]
-#' * [`*`][*()]
-#' * [`+`][+()]
-#' * [`-`][-()]
-#' * [`/`][/()]
-#' * [`<`][<()]
-#' * [`<=`][<=()]
-#' * [`==`][==()]
-#' * [`>`][>()]
-#' * [`>=`][>=()]
+#' * [`!`][base::!()]
+#' * [`!=`][base::!=()]
+#' * [`%%`][base::%%()]
+#' * [`%/%`][base::%/%()]
+#' * [`%in%`][base::%in%()]
+#' * [`&`][base::&()]
+#' * [`*`][base::*()]
+#' * [`+`][base::+()]
+#' * [`-`][base::-()]
+#' * [`/`][base::/()]
+#' * [`<`][base::<()]
+#' * [`<=`][base::<=()]
+#' * [`==`][base::==()]
+#' * [`>`][base::>()]
+#' * [`>=`][base::>=()]
#' * [`ISOdate()`][base::ISOdate()]
#' * [`ISOdatetime()`][base::ISOdatetime()]
-#' * [`^`][^()]
+#' * [`^`][base::^()]
#' * [`abs()`][base::abs()]
#' * [`acos()`][base::acos()]
#' * [`acosh()`][base::acosh()]
@@ -195,7 +195,7 @@
#' * [`tolower()`][base::tolower()]
#' * [`toupper()`][base::toupper()]
#' * [`trunc()`][base::trunc()]
-#' * [`|`][|()]
+#' * [`|`][base::|()]
#'
#' ## bit64
#'
diff --git a/r/R/filesystem.R b/r/R/filesystem.R
index 99c09c40dc..3ef5f483e2 100644
--- a/r/R/filesystem.R
+++ b/r/R/filesystem.R
@@ -189,6 +189,31 @@ FileSelector$create <- function(base_dir, allow_not_found = FALSE, recursive = F
#' - `default_metadata`: default metadata to write in new objects.
#' - `project_id`: the project to use for creating buckets.
#'
+#' `AzureFileSystem$create()` takes following required argument:
+#'
+#' - `account_name`: Azure Blob Storage account name.
+#'
+#' `AzureFileSystem$create()` takes following optional arguments:
+#'
+#' - `account_key`: Account key of the storage account. Cannot be used with
+#' `sas_token`.
+#' - `blob_storage_authority`: Hostname of the blob service, defaulting to
+#' `"blob.core.windows.net"`.
+#' - `blob_storage_scheme`: Either `"http"` or `"https"` (the default).
+#' - `client_id`: The client/application ID for Azure Active Directory
+#' authentication. If used with `client_secret` and `tenant_id` then it is the
+#' application ID for a registered Azure AD application. Otherwise, it is the
+#' client ID of a user-assigned managed identity.
+#' - `client_secret`: Client secret for Azure Active Directory authentication.
+#' Must be provided with both `client_id` and `tenant_id`.
+#' - `dfs_storage_authority`: Hostname of the data lake (gen 2) service,
+#' defaulting to `"dfs.core.windows.net"`.
+#' - `dfs_storage_scheme`: Either `"http"` or `"https"` (the default).
+#' - `sas_token`: Shared access signature (SAS) token for the storage account.
+#' Cannot be used with `account key`.
+#' - `tenant_id`: Tenant ID for Azure Active Directory authentication. Must
+#' be provided with both `client_id` and `client_secret`.
+#'
#' @section Methods:
#'
#' - `path(x)`: Create a `SubTreeFileSystem` from the current `FileSystem`
@@ -253,6 +278,13 @@ FileSelector$create <- function(base_dir, allow_not_found = FALSE, recursive = F
#' (the default), 'ERROR', 'WARN', 'INFO', 'DEBUG' (recommended), 'TRACE', and
#' 'OFF'.
#'
+#' On `AzureFileSystem`, passing no arguments for authentication uses the
+#' `AzureDefaultCredential` for authentication, so that several authentication
+#' types are tried until one succeeds.
+#'
+#' `AzureFileSystem` is not presently supported on Windows due to upstream
+#' compatibility issues between the Azure C++ SDK and the MinGW toolchain.
+#'
#' @usage NULL
#' @format NULL
#' @docType class
@@ -645,6 +677,95 @@ GcsFileSystem$create <- function(anonymous = FALSE, retry_limit_seconds = 15, ..
fs___GcsFileSystem__Make(anonymous, options)
}
+#' @usage NULL
+#' @format NULL
+#' @rdname FileSystem
+#' @importFrom utils modifyList
+#' @export
+AzureFileSystem <- R6Class(
+ "AzureFileSystem",
+ inherit = FileSystem
+)
+
+AzureFileSystem$create <- function(account_name, ...) {
+ options <- list(...)
+ valid_opts <- c(
+ "account_key",
+ "blob_storage_authority",
+ "blob_storage_scheme",
+ "client_id",
+ "client_secret",
+ "dfs_storage_authority",
+ "dfs_storage_scheme",
+ "sas_token",
+ "tenant_id"
+ )
+
+ invalid_opts <- setdiff(names(options), valid_opts)
+ if (length(invalid_opts)) {
+ stop(
+ "Invalid options for AzureFileSystem: ",
+ oxford_paste(invalid_opts),
+ call. = FALSE
+ )
+ }
+ # The c++ code assumes that the various combinations of authentication methods
+ # have been validated in this function.
+ if (!is.null(options$tenant_id) || !is.null(options$client_id) || !is.null(options$client_secret)) {
+ if (is.null(options$client_id)) {
+ stop(
+ "`client_id` must be given with `tenant_id` and `client_secret`",
+ call. = FALSE
+ )
+ }
+ if (sum(is.null(options$tenant_id), is.null(options$client_secret)) == 1) {
+ stop(
+ "Provide only `client_id` to authenticate with ",
+ "Managed Identity Credential, or provide `client_id`, `tenant_id`, ",
+ "and`client_secret` to authenticate with Client Secret Credential",
+ call. = FALSE
+ )
+ }
+ } else if (!is.null(options$account_key) && !is.null(options$sas_token)) {
+ stop(
+ "Cannot specify both `account_key` and `sas_token`",
+ call. = FALSE
+ )
+ }
+
+ fs___AzureFileSystem__Make(c(account_name = account_name, options))
+}
+
+#' Connect to an Azure Blob Storage container
+#'
+#' `az_conainer` is a convenience function to create an `AzureFileSystem` object
+#' that provides a file system interface for blob storage containers in an Azure
+#' Storage Account.
+#'
+#' @param container_path string Container name or path.
+#' @param ... Additional connection options, passed to `AzureFileSystem$create()`.
+#'
+#' @return A `SubTreeFileSystem` containing an `AzureFileSystem` and the container's
+#' relative path. Note that this function's success does not guarantee that you
+#' are authorized to access the container's contents.
+#' @examplesIf FALSE
+#' container_fs <- az_container(
+#' container_path = "arrow-datasets",
+#' account_name = azurite_account_name,
+#' account_key = azurite_account_key,
+#' blob_storage_authority = azurite_blob_storage_authority,
+#' blob_storage_scheme = azurite_blob_storage_scheme
+#' )
+#' @export
+az_container <- function(container_path, ...) {
+ assert_that(is.string(container_path))
+ args <- list2(...)
+
+ fs <- exec(AzureFileSystem$create, !!!args)
+
+ SubTreeFileSystem$create(container_path, fs)
+}
+
#' @usage NULL
#' @format NULL
#' @rdname FileSystem
diff --git a/r/R/type.R b/r/R/type.R
index 14a4c8f1d2..da60b027de 100644
--- a/r/R/type.R
+++ b/r/R/type.R
@@ -69,8 +69,6 @@ FLOAT_TYPES <- c("float16", "float32", "float64", "halffloat", "float", "double"
#' Infer the arrow Array type from an R object
#'
-#' [type()] is deprecated in favor of [infer_type()].
-#'
#' @param x an R object (usually a vector) to be converted to an [Array] or
#' [ChunkedArray].
#' @param ... Passed to S3 methods
@@ -88,12 +86,6 @@ FLOAT_TYPES <- c("float16", "float32", "float64", "halffloat", "float", "double"
#' @export
infer_type <- function(x, ...) UseMethod("infer_type")
-#' @rdname infer_type
-#' @export
-type <- function(x) {
- .Deprecated("infer_type")
- infer_type(x)
-}
#' @export
infer_type.default <- function(x, ..., from_array_infer_type = FALSE) {
diff --git a/r/data-raw/docgen.R b/r/data-raw/docgen.R
index 13e9195cce..7b577323f2 100644
--- a/r/data-raw/docgen.R
+++ b/r/data-raw/docgen.R
@@ -101,10 +101,16 @@ render_fun <- function(fun, pkg_fun, notes) {
# Make it \code{} for better formatting
fun <- paste0("`", fun, "`")
# Wrap in \link{}
+ # Operators need base:: prefix to disambiguate from other packages (e.g. bit64)
+ link_target <- ifelse(
+ !not_operators & !grepl("::", pkg_fun),
+ paste0("base::", pkg_fun),
+ pkg_fun
+ )
out <- ifelse(
pkg_fun %in% do_not_link,
fun,
- paste0("[", fun, "][", pkg_fun, "()]")
+ paste0("[", fun, "][", link_target, "()]")
)
# Add notes after :, if exist
has_notes <- nzchar(notes)
diff --git a/r/man/FileSystem.Rd b/r/man/FileSystem.Rd
index 83e7fc6526..f21c69c0a5 100644
--- a/r/man/FileSystem.Rd
+++ b/r/man/FileSystem.Rd
@@ -6,6 +6,7 @@
\alias{LocalFileSystem}
\alias{S3FileSystem}
\alias{GcsFileSystem}
+\alias{AzureFileSystem}
\alias{SubTreeFileSystem}
\title{FileSystem classes}
\description{
@@ -89,6 +90,33 @@ the filesystem encounters errors. Default is 15 seconds.
\item \code{default_metadata}: default metadata to write in new objects.
\item \code{project_id}: the project to use for creating buckets.
}
+
+\code{AzureFileSystem$create()} takes following required argument:
+\itemize{
+\item \code{account_name}: Azure Blob Storage account name.
+}
+
+\code{AzureFileSystem$create()} takes following optional arguments:
+\itemize{
+\item \code{account_key}: Account key of the storage account. Cannot be used with
+\code{sas_token}.
+\item \code{blob_storage_authority}: Hostname of the blob service, defaulting to
+\code{"blob.core.windows.net"}.
+\item \code{blob_storage_scheme}: Either \code{"http"} or \code{"https"} (the default).
+\item \code{client_id}: The client/application ID for Azure Active Directory
+authentication. If used with \code{client_secret} and \code{tenant_id} then it is the
+application ID for a registered Azure AD application. Otherwise, it is the
+client ID of a user-assigned managed identity.
+\item \code{client_secret}: Client secret for Azure Active Directory authentication.
+Must be provided with both \code{client_id} and \code{tenant_id}.
+\item \code{dfs_storage_authority}: Hostname of the data lake (gen 2) service,
+defaulting to \code{"dfs.core.windows.net"}.
+\item \code{dfs_storage_scheme}: Either \code{"http"} or \code{"https"} (the default).
+\item \code{sas_token}: Shared access signature (SAS) token for the storage account.
+Cannot be used with \verb{account key}.
+\item \code{tenant_id}: Tenant ID for Azure Active Directory authentication. Must
+be provided with both \code{client_id} and \code{client_secret}.
+}
}
\section{Methods}{
@@ -161,5 +189,12 @@ environment variable \code{ARROW_S3_LOG_LEVEL} (e.g.,
to running any code that interacts with S3. Possible values include 'FATAL'
(the default), 'ERROR', 'WARN', 'INFO', 'DEBUG' (recommended), 'TRACE', and
'OFF'.
+
+On \code{AzureFileSystem}, passing no arguments for authentication uses the
+\code{AzureDefaultCredential} for authentication, so that several authentication
+types are tried until one succeeds.
+
+\code{AzureFileSystem} is not presently supported on Windows due to upstream
+compatibility issues between the Azure C++ SDK and the MinGW toolchain.
}
diff --git a/r/man/acero.Rd b/r/man/acero.Rd
index 3821eaef3a..0cd6e284e4 100644
--- a/r/man/acero.Rd
+++ b/r/man/acero.Rd
@@ -72,7 +72,7 @@ can assume that the function works in Acero just as it does in R.
Functions can be called either as \code{pkg::fun()} or just \code{fun()}, i.e. both
\code{str_sub()} and \code{stringr::str_sub()} work.
-In addition to these functions, you can call any of Arrow's 281 compute
+In addition to these functions, you can call any of Arrow's 254 compute
functions directly. Arrow has many functions that don't map to an existing R
function. In other cases where there is an R function mapping, you can still
call the Arrow function directly if you don't want the adaptations that the R
@@ -89,24 +89,24 @@ as \code{arrow_ascii_is_decimal}.
\subsection{base}{
\itemize{
-\item \code{\link{!}}
-\item \code{\link{!=}}
-\item \code{\link{\%\%}}
-\item \code{\link{\%/\%}}
-\item \code{\link{\%in\%}}
-\item \code{\link{&}}
-\item \code{\link{*}}
-\item \code{\link{+}}
-\item \code{\link{-}}
-\item \code{\link{/}}
-\item \code{\link{<}}
-\item \code{\link{<=}}
-\item \code{\link{==}}
-\item \code{\link{>}}
-\item \code{\link{>=}}
+\item \code{\link[base:!]{!}}
+\item \code{\link[base:!=]{!=}}
+\item \code{\link[base:\%\%]{\%\%}}
+\item \code{\link[base:\%/\%]{\%/\%}}
+\item \code{\link[base:\%in\%]{\%in\%}}
+\item \code{\link[base:&]{&}}
+\item \code{\link[base:*]{*}}
+\item \code{\link[base:+]{+}}
+\item \code{\link[base:-]{-}}
+\item \code{\link[base:/]{/}}
+\item \code{\link[base:<]{<}}
+\item \code{\link[base:<=]{<=}}
+\item \code{\link[base:==]{==}}
+\item \code{\link[base:>]{>}}
+\item \code{\link[base:>=]{>=}}
\item \code{\link[base:ISOdate]{ISOdate()}}
\item \code{\link[base:ISOdatetime]{ISOdatetime()}}
-\item \code{\link{^}}
+\item \code{\link[base:^]{^}}
\item \code{\link[base:abs]{abs()}}
\item \code{\link[base:acos]{acos()}}
\item \code{\link[base:acosh]{acosh()}}
@@ -184,7 +184,7 @@ Valid values are "s", "ms" (default), "us", "ns".
\item \code{\link[base:tolower]{tolower()}}
\item \code{\link[base:toupper]{toupper()}}
\item \code{\link[base:trunc]{trunc()}}
-\item \code{\link{|}}
+\item \code{\link[base:|]{|}}
}
}
diff --git a/r/man/arrow_info.Rd b/r/man/arrow_info.Rd
index a839d3ba8f..9585662e76 100644
--- a/r/man/arrow_info.Rd
+++ b/r/man/arrow_info.Rd
@@ -2,7 +2,6 @@
% Please edit documentation in R/arrow-info.R
\name{arrow_info}
\alias{arrow_info}
-\alias{arrow_available}
\alias{arrow_with_acero}
\alias{arrow_with_dataset}
\alias{arrow_with_substrait}
@@ -14,8 +13,6 @@
\usage{
arrow_info()
-arrow_available()
-
arrow_with_acero()
arrow_with_dataset()
diff --git a/r/man/infer_type.Rd b/r/man/infer_type.Rd
index 1bba272556..92c430d415 100644
--- a/r/man/infer_type.Rd
+++ b/r/man/infer_type.Rd
@@ -2,12 +2,9 @@
% Please edit documentation in R/type.R
\name{infer_type}
\alias{infer_type}
-\alias{type}
\title{Infer the arrow Array type from an R object}
\usage{
infer_type(x, ...)
-
-type(x)
}
\arguments{
\item{x}{an R object (usually a vector) to be converted to an \link{Array} or
@@ -19,7 +16,7 @@ type(x)
An arrow \link[=data-type]{data type}
}
\description{
-\code{\link[=type]{type()}} is deprecated in favor of \code{\link[=infer_type]{infer_type()}}.
+Infer the arrow Array type from an R object
}
\examples{
infer_type(1:10)
diff --git a/r/src/type_infer.cpp b/r/src/type_infer.cpp
index 76a1499305..b492cfde1c 100644
--- a/r/src/type_infer.cpp
+++ b/r/src/type_infer.cpp
@@ -222,7 +222,7 @@ std::shared_ptr<arrow::DataType> InferArrowType(SEXP x) {
cpp11::sexp type_result = cpp11::package("arrow")["infer_type"](
x, cpp11::named_arg("from_array_infer_type") = true);
if (!Rf_inherits(type_result, "DataType")) {
- cpp11::stop("type() did not return an object of type DataType");
+ cpp11::stop("infer_type() did not return an object of type DataType");
}
return cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(type_result);
diff --git a/r/tests/testthat/test-arrow-info.R b/r/tests/testthat/test-arrow-info.R
index addd3d740c..9eac608148 100644
--- a/r/tests/testthat/test-arrow-info.R
+++ b/r/tests/testthat/test-arrow-info.R
@@ -21,7 +21,3 @@ test_that("arrow_info()", {
options(arrow.foo = FALSE)
expect_output(print(arrow_info()), "arrow.foo")
})
-
-test_that("arrow_available() is deprecated", {
- expect_deprecated(arrow_available(), "always")
-})
diff --git a/r/tests/testthat/test-type.R b/r/tests/testthat/test-type.R
index 74c868faac..e45dd2c051 100644
--- a/r/tests/testthat/test-type.R
+++ b/r/tests/testthat/test-type.R
@@ -327,15 +327,6 @@ test_that("infer_type() infers type for vctrs", {
)
})
-test_that("type() is deprecated", {
- a <- Array$create(1:10)
- expect_deprecated(
- a_type <- type(a),
- "infer_type"
- )
- expect_equal(a_type, a$type)
-})
-
test_that("infer_type() infers type for lists of raw() as binary()", {
expect_equal(
infer_type(list(raw())),
(arrow) 03/06: MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake (#50317)
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thisisnic pushed a commit to branch maint-25.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit df0fca684d9637df7f788a127fc1689cf49dfbde
Author: Rok Mihevc <ro...@mihevc.org>
AuthorDate: Mon Jul 6 11:37:46 2026 +0200
MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake (#50317)
### Rationale for this change
See [failure here](https://github.com/ursacomputing/crossbow/actions/runs/28486933942/job/84435321636#step:6:719).
### What changes are included in this PR?
Bash command used is adjusted to prevent this error.
```bash
/usr/bin/cmake --build . --target install -- -j 2
gmake: the '-j' option requires a positive integer argument
```
### Are these changes tested?
By CI.
### Are there any user-facing changes?
No.
Lead-authored-by: Rok Mihevc <ro...@mihevc.org>
Co-authored-by: Copilot Autofix powered by AI <17...@users.noreply.github.com>
Signed-off-by: Rok Mihevc <ro...@mihevc.org>
---
r/tools/nixlibs.R | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R
index ba705e03ad..dd230c3764 100644
--- a/r/tools/nixlibs.R
+++ b/r/tools/nixlibs.R
@@ -526,7 +526,8 @@ build_libarrow <- function(src_dir, dst_dir) {
# Set up make for parallel building
# CRAN policy says not to use more than 2 cores during checks
# If you have more and want to use more, set MAKEFLAGS or NOT_CRAN
- ncores <- parallel::detectCores()
+ # detectCores() returns NA if number of cores is unknown. Set ncores to 1 if NA.
+ ncores <- max(1, parallel::detectCores(), na.rm = TRUE)
if (!not_cran) {
ncores <- min(ncores, 2)
}