You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/06 18:56:23 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #3365: Review use of panic in datafusion-proto crate

andygrove commented on code in PR #3365:
URL: https://github.com/apache/arrow-datafusion/pull/3365#discussion_r964064924


##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -385,7 +385,8 @@ impl AsLogicalPlan for LogicalPlanNode {
                 let table_paths = &scan
                     .paths
                     .iter()
-                    .map(|p| ListingTableUrl::parse(p).unwrap())
+                    .filter_map(|p| ListingTableUrl::parse(p).ok())
+                    //.map(|p| ListingTableUrl::parse(p).unwrap())
                     .collect::<Vec<ListingTableUrl>>();

Review Comment:
   We don't want to silently ignore errors. How about this approach instead?
   
   ```suggestion
                       .map(|p| ListingTableUrl::parse(p))
                       .collect::<Result<Vec<_>, _>>()?;
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org