avantgardnerio commented on code in PR #3365:
URL: https://github.com/apache/arrow-datafusion/pull/3365#discussion_r966089613
##########
datafusion/proto/build.rs:
##########
@@ -32,7 +32,9 @@ fn main() -> Result<(), String> {
fn build() -> Result<(), String> {
use std::io::Write;
- let out = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
+ let out = std::path::PathBuf::from(
+ std::env::var("OUT_DIR").expect("Cannot find OUT_DIR environment
vairable"),
Review Comment:
`expect` seems semi-reasonable in tests or `build.rs`
##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -632,6 +632,7 @@ impl AsLogicalPlan for LogicalPlanNode {
)));
}
+ // unwrap is safe here because of len check above
let mut builder =
LogicalPlanBuilder::from(input_plans.pop().unwrap());
Review Comment:
```suggestion
let first =
input_plans.pop().ok_or(DataFusionError::Internal(String::from(
"Protobuf deserialization error, Union was require
at least two input.",
)))?;
let mut builder = LogicalPlanBuilder::from(first);
```
##########
datafusion/proto/src/from_proto.rs:
##########
@@ -1341,6 +1343,7 @@ impl From<protobuf::IntervalUnit> for IntervalUnit {
}
}
+// panic here bcos no better way to convert from Vec to Array
Review Comment:
```suggestion
// panic here because no better way to convert from Vec to Array
```
I think it's important to keep good grammar in the codebase because terms
like this would be confusing to non-native English speakers.
--
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]