houqp commented on a change in pull request #1541:
URL: https://github.com/apache/arrow-datafusion/pull/1541#discussion_r783397832
##########
File path: datafusion/src/error.rs
##########
@@ -101,6 +104,12 @@ impl From<ParserError> for DataFusionError {
}
}
+impl From<Box<dyn Error + Send + Sync>> for DataFusionError {
+ fn from(err: Box<dyn Error + Send + Sync>) -> Self {
+ DataFusionError::External(err)
+ }
+}
+
Review comment:
I should probably have a IOError or ObjectStoreError enum variant
specifically for wrapping object store errors :)
As for downcasting error trait objects, it's best to be managed by the users
because datafusion core will not have access to all different types of error
that plugin object store will return. We can do that for arrow compute kernels
because arrow is a dependency of datafusion.
##########
File path: datafusion/src/error.rs
##########
@@ -101,6 +104,12 @@ impl From<ParserError> for DataFusionError {
}
}
+impl From<Box<dyn Error + Send + Sync>> for DataFusionError {
+ fn from(err: Box<dyn Error + Send + Sync>) -> Self {
+ DataFusionError::External(err)
+ }
+}
+
Review comment:
We should probably have a IOError or ObjectStoreError enum variant
specifically for wrapping object store errors :)
As for downcasting error trait objects, it's best to be managed by the users
because datafusion core will not have access to all different types of error
that plugin object store will return. We can do that for arrow compute kernels
because arrow is a dependency of datafusion.
--
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]