[BUG] Comparisons involving `NaN` produce inconsistent results between cudf.polars and polars.
Open
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
Assessment
This issue has not been assessed yet.