alamb commented on code in PR #15737:
URL: https://github.com/apache/datafusion/pull/15737#discussion_r2049073244


##########
datafusion/proto/src/logical_plan/mod.rs:
##########
@@ -458,23 +458,24 @@ impl AsLogicalPlan for LogicalPlanNode {
                     .map(ListingTableUrl::parse)
                     .collect::<Result<Vec<_>, _>>()?;
 
+                let partition_columns = scan
+                    .table_partition_cols
+                    .iter()
+                    .map(|col| {
+                        let arrow_type =
+                            
col.arrow_type.as_ref().unwrap().try_into().map_err(|e| {
+                                proto_error(format!(
+                                    "Received an unknown ArrowType: {}",
+                                    e
+                                ))
+                            })?;

Review Comment:
   I think it would be good to avoid an unwrap here as that will panic rather 
than returning an error on invalid protobuf
   
   ```suggestion
                           let Some(arrow_type) = col.arrow_type.as_ref() else {
                               return Err(proto_error(format!(
                                   "Missing Arrow type in partition columns"
                               )));
                           };
                          let arrow_type = 
DataType::try_from(arrow_type).map_err(|e| {
                               proto_error(format!("Received an unknown 
ArrowType: {}", e))
                           })?;
   ```



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to