alamb commented on code in PR #7115:
URL: https://github.com/apache/arrow-datafusion/pull/7115#discussion_r1281092037


##########
datafusion/common/src/error.rs:
##########
@@ -411,6 +399,56 @@ impl DataFusionError {
     }
 }
 
+/// Unwrap an `Option` if possible. Otherwise return an 
`DataFusionError::Internal`.

Review Comment:
   👍  very nice



##########
datafusion/core/tests/sql/mod.rs:
##########
@@ -405,10 +406,7 @@ async fn register_tpch_csv_data(
             DataType::Decimal128(_, _) => {
                 
cols.push(Box::new(Decimal128Builder::with_capacity(records.len())))
             }
-            _ => {
-                let msg = format!("Not implemented: {}", field.data_type());
-                Err(DataFusionError::Plan(msg))?
-            }
+            _ => plan_err!("Not implemented: {}", field.data_type())?,

Review Comment:
   This change didn't introduce this strangeness, but this should probably be 
"NotImplemented" rather than a PlanError



##########
datafusion/common/src/error.rs:
##########
@@ -411,6 +399,56 @@ impl DataFusionError {
     }
 }
 
+/// Unwrap an `Option` if possible. Otherwise return an 
`DataFusionError::Internal`.

Review Comment:
   👍  very nice



-- 
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]

Reply via email to