Skip to content

[R] is.nan() evaluates to null on Arrow null values #28583

@asfimport

Description

@asfimport
> is.nan(NA_real_)
[1] FALSE 

> as.vector(is.nan(Scalar$create(NA_real_)))
[1] NA

There is a discrepancy here between the FALSE result in R and the null result in Arrow (which results in NA_logical_ when converted to an R vector).

I don't think the is_nan C++ kernel should change here because this is just a quirk of R. For example, NumPy and pandas is consistent with the Arrow C++:

> np.isnan(pd.NA)
<NA>

We could maybe consider adding a boolean option to the is_nan C++ kernel to control whether to consider nulls as NaN.

Reporter: Ian Cook / @ianmcook
Assignee: Ian Cook / @ianmcook

Related issues:

Note: This issue was originally created as ARROW-12850. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions