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/11/30 09:21:01 UTC

[GitHub] [arrow-datafusion] crepererum opened a new pull request, #4437: feat: `DataFusionError::find_root`

crepererum opened a new pull request, #4437:
URL: https://github.com/apache/arrow-datafusion/pull/4437

   # Which issue does this PR close?
   Closes #4435.
   
   # Rationale for this change
   It would be nice to get the typed "original" error, even when it is wrapped into a chain of `ExternalError`, `ArrowError`, `Arc` etc. The original error could be used to generate HTTP status codes in certain situations, e.g. "resource exhausted".
   
   # What changes are included in this PR?
   ```rust
   impl DataFusionError {
       /// Get underlying error.
       ///
       /// This may be the same as `self`.
       pub fn find_root(&self) -> &Self {...}
   }
   ```
   
   # Are these changes tested?
   - `test_find_root_error`
   
   # Are there any user-facing changes?
   New method for `DataFusionError`.


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


[GitHub] [arrow-datafusion] alamb merged pull request #4437: feat: `DataFusionError::find_root`

Posted by GitBox <gi...@apache.org>.
alamb merged PR #4437:
URL: https://github.com/apache/arrow-datafusion/pull/4437


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


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4437: feat: `DataFusionError::find_root`

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #4437:
URL: https://github.com/apache/arrow-datafusion/pull/4437#discussion_r1036108112


##########
datafusion/common/src/error.rs:
##########
@@ -333,8 +334,101 @@ impl From<DataFusionError> for io::Error {
     }
 }
 
+/// Helper for [`DataFusionError::find_root`].
+enum OtherErr<'a> {
+    Arrow(&'a ArrowError),
+    Dyn(&'a (dyn std::error::Error + Send + Sync + 'static)),
+}
+
+impl DataFusionError {
+    /// Get underlying error.

Review Comment:
   ```suggestion
       /// Get deepest underlying [`DataFusionError`]
       ///
       /// [`DatafusionError`]s sometimes form a chain, such as `DatafusionError::ArrowError()` in order to conform
       /// to the correct error signature. Thus sometimes there is a chain several layers deep that can obscure the
       /// original error. This function finds the lowest level DataFusionError possible.
       ///
       /// For example,  `find_root` will return`DataFusionError::ResourceExhausted` given the input
       /// ```text
       /// DataFusionError::ArrowError
       ///   ArrowError::External
       ///    Box(DataFusionError::Context)
       ///      DataFusionError::ResourceExhausted
       /// ```
   ```



##########
datafusion/common/src/error.rs:
##########
@@ -353,6 +447,61 @@ mod test {
         assert_eq!(res.to_string(), "Arrow error: Schema error: bar");
     }
 
+    #[test]
+    fn test_find_root_error() {

Review Comment:
   👍 



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


[GitHub] [arrow-datafusion] ursabot commented on pull request #4437: feat: `DataFusionError::find_root`

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #4437:
URL: https://github.com/apache/arrow-datafusion/pull/4437#issuecomment-1333687284

   Benchmark runs are scheduled for baseline = ffe97e5a9459990b8167b66705b7a413f5289f35 and contender = f8ec401a434a0f8d5130aa8e94ba782b8afa4b5d. f8ec401a434a0f8d5130aa8e94ba782b8afa4b5d is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/a78334d797a143da9d8a53d2765b67cc...76f7fa76a1ab4c1bb8cb2460aef4be1a/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/65808e610e824e8fa3c695efede11ec9...ab36b8527c4d46f3a1a2dda3aa773714/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/475c74b635a04071a01219889c0c9703...29afd6d93ff240b6a6973f93aa0e252e/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/15a43c1eb2ea459a8c53b7b6a896da74...271d7a4b30b24adabb8acdcd99700f29/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


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