You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "codope (via GitHub)" <gi...@apache.org> on 2024/07/09 17:03:28 UTC

[PR] feat(config): enhance error handling with custom ConfigError type [hudi-rs]

codope opened a new pull request, #59:
URL: https://github.com/apache/hudi-rs/pull/59

   - Created ConfigError enum for more robust error handling
   - Updated ConfigParser trait and its implementations to use ConfigError
   - Modified HudiInternalConfig, HudiReadConfig, and HudiTableConfig to leverage ConfigError
   - Adjusted tests to align with new error handling


-- 
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: commits-unsubscribe@hudi.apache.org

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


Re: [PR] refactor: enhance error handling with custom ConfigError type [hudi-rs]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #59:
URL: https://github.com/apache/hudi-rs/pull/59#issuecomment-2218250821

   ## [Codecov](https://app.codecov.io/gh/apache/hudi-rs/pull/59?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `95.12195%` with `2 lines` in your changes missing coverage. Please review.
   > Project coverage is 87.17%. Comparing base [(`c454088`)](https://app.codecov.io/gh/apache/hudi-rs/commit/c454088f32e352309693ffcd5b408ebfe88a1064?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`c01adc4`)](https://app.codecov.io/gh/apache/hudi-rs/commit/c01adc469f8eb208782116da07666a1b3bf02e92?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files](https://app.codecov.io/gh/apache/hudi-rs/pull/59?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [crates/core/src/config/mod.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/59?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Fconfig%2Fmod.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2NvbmZpZy9tb2QucnM=) | 77.77% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main      #59      +/-   ##
   ==========================================
   - Coverage   87.19%   87.17%   -0.02%     
   ==========================================
     Files          13       13              
     Lines         687      702      +15     
   ==========================================
   + Hits          599      612      +13     
   - Misses         88       90       +2     
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/hudi-rs/pull/59?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
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: commits-unsubscribe@hudi.apache.org

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


Re: [PR] refactor: enhance error handling with custom ConfigError type [hudi-rs]

Posted by "xushiyan (via GitHub)" <gi...@apache.org>.
xushiyan commented on PR #59:
URL: https://github.com/apache/hudi-rs/pull/59#issuecomment-2525295196

   this was covered in https://github.com/apache/hudi-rs/pull/215


-- 
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: commits-unsubscribe@hudi.apache.org

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


Re: [PR] refactor: enhance error handling with custom ConfigError type [hudi-rs]

Posted by "xushiyan (via GitHub)" <gi...@apache.org>.
xushiyan commented on code in PR #59:
URL: https://github.com/apache/hudi-rs/pull/59#discussion_r1671383401


##########
crates/core/src/config/mod.rs:
##########
@@ -18,14 +18,33 @@
  */
 use std::any::type_name;
 use std::collections::HashMap;
+use std::error::Error;
+use std::fmt;
 use std::sync::Arc;
 
-use anyhow::Result;
-
 pub mod internal;
 pub mod read;
 pub mod table;
 
+#[derive(Debug)]
+pub enum ConfigError {
+    NotFound,
+    ParseError(String),
+    Other(String),

Review Comment:
   that's a nice improvement. I would suggest capture underlying error as source, like ParseError should capture std::ParseIntError, etc, and NotFound should capture which key (ConfigParser) it refers to.
   
   On a bigger scope, we should definitely standardize error types throughout hudi-core and other hudi crates. I chose `anyhow` for fast iteration and uncover error handling paths first. So all errors come out from hudi are now anyhow::Error. I suggest replace anyhow dependency with well-defined custom error enums implemented with [thiserror](https://docs.rs/thiserror/latest/thiserror/) in the next release.



-- 
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: commits-unsubscribe@hudi.apache.org

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


Re: [PR] refactor: enhance error handling with custom ConfigError type [hudi-rs]

Posted by "xushiyan (via GitHub)" <gi...@apache.org>.
xushiyan closed pull request #59: refactor: enhance error handling with custom ConfigError type
URL: https://github.com/apache/hudi-rs/pull/59


-- 
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: commits-unsubscribe@hudi.apache.org

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