Skip to content

Commit

Permalink
make exhaustive
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGS committed Jan 14, 2025
1 parent bb0e484 commit aa8b243
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vortex-dtype/src/dtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,29 @@ impl DType {
pub fn eq_ignore_nullability(&self, other: &Self) -> bool {
match (self, other) {
(Null, Null) => true,
(Null, _) => false,
(Bool(_), Bool(_)) => true,
(Bool(_), _) => false,
(Primitive(lhs_ptype, _), Primitive(rhs_ptype, _)) => lhs_ptype == rhs_ptype,
(Primitive(..), _) => false,
(Utf8(_), Utf8(_)) => true,
(Utf8(_), _) => false,
(Binary(_), Binary(_)) => true,
(Binary(_), _) => false,
(List(lhs_dtype, _), List(rhs_dtype, _)) => lhs_dtype.eq_ignore_nullability(rhs_dtype),
(List(..), _) => false,
(Struct(lhs_dtype, _), Struct(rhs_dtype, _)) => {
(lhs_dtype.names() == rhs_dtype.names())
&& (lhs_dtype
.dtypes()
.zip(rhs_dtype.dtypes())
.all(|(l, r)| l.eq_ignore_nullability(&r)))
}
(Struct(..), _) => false,
(Extension(lhs_extdtype), Extension(rhs_extdtype)) => {
lhs_extdtype.id() == rhs_extdtype.id()
}
_ => false,
(Extension(_), _) => false,
}
}

Expand Down

0 comments on commit aa8b243

Please sign in to comment.