Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-10042: [Rust] Fix tests involving ArrayData/Buffer equality
The tests added, unignored, and modified in this PR should illustrate the behavior I'm going for. This gets 2 ignored Parquet -> Arrow roundtrip tests to pass because they were only failing due to differences in their `ArrayData`'s `BufferData` capacities. This leaves `BufferData`'s `PartialEq` implementation as-is (that is, taking the equality of `capacity` into account) and does not modify any of the tests in rust/arrow/src/array/{array, builder, union}.rs or in rust/arrow/src/compute/{kernels/cast, kernels/filter, util}.rs that are testing the internal implementation of `Buffer`. This *does* change `PartialEq` for `ArrayData` to [not assert to fix the problems noted](apache#8546 (comment)) by @jorgecarleitao . This has the downside of making test failures where `ArrayData`s should be equal but aren't harder to interpret because the `assert_eq!`s aren't as granular. We can't use `debug_assert_eq!` either, because then we can't write tests that do `assert_ne!(array_data1, array_data2)` (I have included an example of such a test). I think to solve this downside, we should add a function only used in tests that does the more granular assertions. I am leaving that to a future PR. Closes apache#8590 from carols10cents/bufferdata-eq Authored-by: Carol (Nichols || Goulding) <[email protected]> Signed-off-by: alamb <[email protected]>
- Loading branch information