-
Notifications
You must be signed in to change notification settings - Fork 30
Use new sedona_internal_err to avoid misleading datafusion internal err #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6961822
Add new sedona_internal_err
petern48 ba294f7
Use sedona_internal_err instead of internal_err in st_xyzm.rs
petern48 d205606
More replacements
petern48 84872b5
Use full import path in macro to avoid needing import
petern48 e834efd
Replace all uses in sedona-funcdtions
petern48 8a6e6e7
Replace with 'sedona_internal_err' in remaining packages
petern48 f718aa7
Update err test case in function_set.rs to use 'contains' instead of …
petern48 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /// Macro to create Sedona Internal Error that avoids the misleading error message from | ||
| /// DataFusionError::Internal. | ||
| #[macro_export] | ||
| macro_rules! sedona_internal_err { | ||
| ($($args:expr),*) => {{ | ||
| let msg = std::format!( | ||
| "SedonaDB internal error: {}{}.\nThis issue was likely caused by a bug in SedonaDB's code. \ | ||
| Please help us to resolve this by filing a bug report in our issue tracker: \ | ||
| https://github.com/apache/sedona-db/issues", | ||
| std::format!($($args),*), | ||
| datafusion_common::DataFusionError::get_back_trace(), | ||
| ); | ||
| // We avoid using Internal to avoid the message suggesting it's internal to DataFusion | ||
| Err(datafusion_common::DataFusionError::External(msg.into())) | ||
| }}; | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use datafusion_common::DataFusionError; | ||
|
|
||
| #[test] | ||
| fn test_sedona_internal_err() { | ||
| let result: Result<(), DataFusionError> = sedona_internal_err!("Test error: {}", "details"); | ||
| assert!(result.is_err()); | ||
| let err = result.unwrap_err(); | ||
| let err_string = err.to_string(); | ||
| assert!(err_string.contains("SedonaDB internal error: Test error: details")); | ||
|
|
||
| // Ensure the message doesn't contain the 'DataFusion'-specific messages | ||
| assert!(!err_string.contains("DataFusion's code")); | ||
| assert!(!err_string.contains("https://github.com/apache/datafusion/issues")); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get the same linking errors in CI that we got before, you could try removing the back trace feature (we can always add it back in later if it turns out that we're having trouble debugging user errors)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's what you meant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it passed !