apache / apache/arrow

[R] Argument names ignored in schema supplied as `in_type` argument to `register_scalar_function()`

Open
#37,761 1 comment 0 reactions 1 assignee Claimed by @thisisnic View on GitHub
Component: R Priority: Medium Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

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

For `in_type`, I would have expected the argument name should match the data. But this doesn't seem to be the case

```
library(arrow)
library(dplyr)
# Make data set
write.csv(sleep, "sleep.csv", row.names = F)

# Register function
register_scalar_function(
name = "f",
fun = function(context, x) as.integer(x),
in_type = schema(blah = int64()), # NOTE: Schema name
out_type = int32(),
auto_convert = TRUE
)

open_dataset("sleep.csv", format = "csv") |>
mutate(f(group)) |>
head() |>
collect()

```

### Component(s)

R

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.