findepi commented on code in PR #13206:
URL: https://github.com/apache/datafusion/pull/13206#discussion_r1825184042


##########
datafusion/expr/src/expr.rs:
##########
@@ -1574,8 +1574,13 @@ impl Expr {
 
     /// Returns true if the expression is volatile, i.e. whether it can return 
different
     /// results when evaluated multiple times with the same input.
-    pub fn is_volatile(&self) -> Result<bool> {
-        self.exists(|expr| Ok(expr.is_volatile_node()))
+    ///
+    /// For example the function call `RANDOM()` is volatile as each call will
+    /// return a different value.
+    ///
+    /// See [`Volatility`] for more information.
+    pub fn is_volatile(&self) -> bool {
+        self.exists(|expr| Ok(expr.is_volatile_node())).unwrap()

Review Comment:
   Add code comment why unwrap is safe here.
   
   btw maybe we can have `exists` variant which doesn't throw?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to