Skip to content

[R] Broken bindings in Math group generics #43163

Closed

Description

@aboyoun

Describe the bug, including details regarding any error messages, version, and platform.

When support was added for cumsum in the Math group generics in the R client, it mistakenly mapped signif, expm1, log1p, cospi, sinpi, tanpi, cosh, sinh, tanh, acosh, asinh, atanh, lgamma, gamma, digamma, and trigamma to the cumulative_sum_checked arrow function.

Here is an example:

R> suppressMessages(library(arrow))
R> cumsum(Array$create(c(0.6, 2.1, 0)))
Array
<double>
[
  0.6,
  2.7,
  2.7
]
R> log1p(Array$create(c(0.6, 2.1, 0)))
Array
<double>
[
  0.6,
  2.7,
  2.7
]
R> packageVersion("arrow")
[1] ‘16.1.0’

The mismapping can be seen in the switch statement below:

> arrow:::Math.ArrowDatum
function (x, ..., base = exp(1), digits = 0) 
{
   switch(.Generic, abs = eval_array_expression("abs_checked", 
       x), ceiling = eval_array_expression("ceil", x), sign = , 
       floor = , trunc = , acos = , asin = , atan = , cos = , 
       sin = , tan = {
           eval_array_expression(.Generic, x)
       }, log = eval_array_expression("logb_checked", x, base), 
       log10 = eval_array_expression("log10_checked", x), round = eval_array_expression("round", 
           x, options = list(ndigits = digits, round_mode = RoundMode$HALF_TO_EVEN)), 
       sqrt = eval_array_expression("sqrt_checked", x), exp = eval_array_expression("power_checked", 
           exp(1), x), signif = , expm1 = , log1p = , cospi = , 
       sinpi = , tanpi = , cosh = , sinh = , tanh = , acosh = , 
       asinh = , atanh = , lgamma = , gamma = , digamma = , 
       trigamma = , cumsum = eval_array_expression("cumulative_sum_checked", 
           x), cumprod = , cummax = , cummin = , stop(paste0("Unsupported operation on `", 
           class(x)[1L], "` : "), .Generic, call. = FALSE))
}

Component(s)

R

Activity

  1. added a commit that references this issue on Jul 7, 2024
  2. added this to the 18.0.0 milestone on Jul 7, 2024
  3. jonkeane commented on Jul 7, 2024

    @jonkeane
    Member

    Issue resolved by pull request 43162
    #43162

  4. added a commit that references this issue on Jul 18, 2024
  5. added
    Critical Fix
    on Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Component: RCritical FixType: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions