This is an automated email from the ASF dual-hosted git repository.

jonah pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new ba094e7292 Minor: Clarify use of infallable APIs (#13217)
ba094e7292 is described below

commit ba094e72924147d4afdd6547aba5e14717ebc58c
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Nov 6 20:52:25 2024 -0500

    Minor: Clarify use of infallable APIs (#13217)
---
 datafusion/expr/src/expr.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs
index 025a48731d..0cdfa05521 100644
--- a/datafusion/expr/src/expr.rs
+++ b/datafusion/expr/src/expr.rs
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to