Skip to content

Commit

Permalink
Minor: Clarify use of infallable APIs (#13217)
Browse files Browse the repository at this point in the history
alamb authored Nov 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6686e03 commit ba094e7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
@@ -1563,13 +1563,13 @@ impl Expr {
/// Returns true if there are any column references in this Expr
pub fn any_column_refs(&self) -> bool {
self.exists(|expr| Ok(matches!(expr, Expr::Column(_))))
.unwrap()
.expect("exists closure is infallible")
}

/// Return true when the expression contains out reference(correlated) expressions.
/// Return true if the expression contains out reference(correlated) expressions.
pub fn contains_outer(&self) -> bool {
self.exists(|expr| Ok(matches!(expr, Expr::OuterReferenceColumn { .. })))
.unwrap()
.expect("exists closure is infallible")
}

/// Returns true if the expression node is volatile, i.e. whether it can return
@@ -1589,7 +1589,8 @@ impl Expr {
///
/// See [`Volatility`] for more information.
pub fn is_volatile(&self) -> bool {
self.exists(|expr| Ok(expr.is_volatile_node())).unwrap()
self.exists(|expr| Ok(expr.is_volatile_node()))
.expect("exists closure is infallible")
}

/// Recursively find all [`Expr::Placeholder`] expressions, and

0 comments on commit ba094e7

Please sign in to comment.