diff --git a/cpp/src/arrow/table.cc b/cpp/src/arrow/table.cc index 5dc5e4c1a9a8c..44eab9902d89c 100644 --- a/cpp/src/arrow/table.cc +++ b/cpp/src/arrow/table.cc @@ -534,9 +534,6 @@ Result> PromoteTableToSchema(const std::shared_ptr } bool Table::Equals(const Table& other, bool check_metadata) const { - if (this == &other) { - return true; - } if (!schema_->Equals(*other.schema(), check_metadata)) { return false; } diff --git a/python/pyarrow/tests/test_table.py b/python/pyarrow/tests/test_table.py index 4c058ccecda5e..e8242fe116ec1 100644 --- a/python/pyarrow/tests/test_table.py +++ b/python/pyarrow/tests/test_table.py @@ -2301,6 +2301,10 @@ def test_table_from_pydict(cls): with pytest.raises(TypeError): cls.from_pydict({'a': [1, 2, 3]}, schema={}) + # With dicts containing NaNs + table = cls.from_pydict({"foo": [float("nan")]}) + assert table != table + @pytest.mark.parametrize('data, klass', [ ((['', 'foo', 'bar'], [4.5, 5, None]), pa.array),