apache / apache/arrow

[Python] `pyarrow.Table` equality comparison behavior is unexpected

Open
#43,985 6 comments 0 reactions 1 assignee Claimed by @Yimche View on GitHub
Component: Python 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.

```python
>>> table = pa.Table.from_pydict({"foo": [float("nan")]})
>>> table.equals(table)
True
```

```python
>>> table_1 = pa.Table.from_pydict({"foo": [float("nan")]})
>>> table_2 = pa.Table.from_pydict({"foo": [float("nan")]})
>>> table_1.equals(table_2)
False
```

This seems... surprising to me. If the NaN comparison is the arrays always results in `False` then it is surprising that the first result is `True`.

### Component(s)

Python

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.