Skip to content

Commit 9468905

Browse files
authored
Revert ParquetError: PartialEq (#4469)
* Revert ParquetError: PartialEq * Review feedback
1 parent 11758df commit 9468905

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

parquet/src/errors.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ use std::{cell, io, result, str};
2323
#[cfg(feature = "arrow")]
2424
use arrow_schema::ArrowError;
2525

26+
/// Parquet error enumeration
27+
// Note: we don't implement PartialEq as the semantics for the
28+
// external variant are not well defined (#4469)
2629
#[derive(Debug)]
2730
pub enum ParquetError {
2831
/// General Parquet error.
@@ -44,23 +47,6 @@ pub enum ParquetError {
4447
External(Box<dyn Error + Send + Sync>),
4548
}
4649

47-
impl PartialEq for ParquetError {
48-
fn eq(&self, other: &Self) -> bool {
49-
match (self, other) {
50-
(Self::General(l0), Self::General(r0)) => l0 == r0,
51-
(Self::NYI(l0), Self::NYI(r0)) => l0 == r0,
52-
(Self::EOF(l0), Self::EOF(r0)) => l0 == r0,
53-
#[cfg(feature = "arrow")]
54-
(Self::ArrowError(l0), Self::ArrowError(r0)) => l0 == r0,
55-
(Self::IndexOutOfBound(l0, l1), Self::IndexOutOfBound(r0, r1)) => {
56-
l0 == r0 && l1 == r1
57-
}
58-
(Self::External(l0), Self::External(r0)) => l0.to_string() == r0.to_string(),
59-
_ => false,
60-
}
61-
}
62-
}
63-
6450
impl std::fmt::Display for ParquetError {
6551
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
6652
match &self {

parquet/src/file/serialized_reader.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,9 @@ mod tests {
810810
let file_iter = read_from_file.get_row_iter(None).unwrap();
811811
let cursor_iter = read_from_cursor.get_row_iter(None).unwrap();
812812

813-
assert!(file_iter.eq(cursor_iter));
813+
for (a, b) in file_iter.zip(cursor_iter) {
814+
assert_eq!(a.unwrap(), b.unwrap())
815+
}
814816
}
815817

816818
#[test]

0 commit comments

Comments
 (0)