GH-43985: [Python][C++] Fixed pyarrow table equality function not comparing table data when comparing against itself #44497
+4
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale for this change
This change is to address issue #43985 in which a bug in the behaviour of equality on pyarrow tables occurs when comparing a table containing a NaN value against itself.
What changes are included in this PR?
if
block inarrow/cpp/src/arrow/table.cc
that forced a return true if memory address of the two items being compared were equal, no matter the data stored inside.Are these changes tested?
Yes. I put a test in the
arrow/python/pyarrow/tests/test_table.py
under thetest_table_from_pydict
function, as I wasn't sure and couldn't find where else to put the test.Are there any user-facing changes?
No
pyarrow.Table
equality comparison behavior is unexpected #43985