NVIDIA / NVIDIA/cudf

[BUG] Comparisons involving `NaN` produce inconsistent results between cudf.polars and polars.

Open
#18,842 5 comments 0 reactions 0 assignees View on GitHub
0 - Blocked bug cudf-polars Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

Polars seems to treat NaN as the largest value in comparisons, whereas cudf.polars follows IEEE 754 (as discussed in https://github.com/rapidsai/cudf/issues/4760). I'm not sure whether this difference is a bug or intended behavior

```python
import numpy as np
import polars as pl

lf = pl.LazyFrame(
{
"a": [None,1., np.nan],
}
)

print(lf.select(pl.col('a')>2).collect())

print(lf.select(pl.col('a')>2).collect(engine='gpu'))

"""
shape: (3, 1)
┌───────┐
│ a │
│ --- │
│ bool │
╞═══════╡
│ null │
│ false │
│ true │
└───────┘

shape: (3, 1)
┌───────┐
│ a │
│ --- │
│ bool │
╞═══════╡
│ null │
│ false │
│ false │
└───────┘
"""
```

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.