devinjdangelo commented on code in PR #10803:
URL: https://github.com/apache/datafusion/pull/10803#discussion_r1627857657
##########
datafusion/sql/src/unparser/ast.rs:
##########
@@ -242,8 +242,8 @@ impl SelectBuilder {
from: self
.from
.iter()
- .map(|b| b.build())
- .collect::<Result<Vec<_>, BuilderError>>()?,
+ .filter_map(|b| b.build().ok().unwrap())
Review Comment:
I think this change will result in a panic on a `UninitializedFieldError`
due to the `unwrap`. E.g. if self.relation is `None` rather than `Some(None)`.
I think we could avoid this by using
[Result::transpose](https://doc.rust-lang.org/std/result/enum.Result.html#method.transpose)
rather than `.ok().unwrap()` here and then continuing to `collect::<Result<T>,
_>`.
--
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]