findepi commented on code in PR #13217:
URL: https://github.com/apache/datafusion/pull/13217#discussion_r1826308184
##########
datafusion/expr/src/expr.rs:
##########
@@ -1554,13 +1554,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")
Review Comment:
i tried to model this in a generic way with something like
````
F: Fn -> R
R: MaybeFallible<bool>
```
```
trait MaybeFallible<T> {
fn is_falure(&self) -> bool;
fn as_value(&self) -> Option<&T>;
```
It's sufficient to model the `exists` function signature generically, but i
couldn't get exist and apply both working (perhaps didn't try long enough)
--
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]