-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add arrow_err!
macros, optional backtrace to ArrowError
#8586
Conversation
arrow_err!
macrosarrow_err!
macros, optional backtrace to ArrowError
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.
Thank you for the contribution @comphead
Looks like a good improvement in error handing to me
@@ -802,7 +802,7 @@ impl<'a, S: SimplifyInfo> TreeNodeRewriter for Simplifier<'a, S> { | |||
&& !info.get_data_type(&left)?.is_floating() | |||
&& is_zero(&right) => | |||
{ | |||
return Err(DataFusionError::ArrowError(ArrowError::DivideByZero)); | |||
return plan_err!("Divide by zero"); |
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.
Is the idea that since the error wasn't actually generated by Arrow then we shouldn't return an Arrow error?
In theory having a structured ArrowError
would be more specific than a general PlanError with a "Divide by zero" message, but I am not sure how much it matters 🤷
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.
Thanks @alamb for this specific case I have doubled checked before modification but there is no arrow kernel being called directly like in other scenarios when ArrowError
is thrown, that was the reason to change
Which issue does this PR close?
Closes partially #7360.
Rationale for this change
Continue covering Datafusion Errors with error macros supporting optional backtrace
What changes are included in this PR?
introduced
arrow_err!
andarrow_datadusion_err!
macros with optional backtrace, to representErr(DatafusionError::ArrowError)
andDatafusionError::ArrowError(_)
Are these changes tested?
Yes
Are there any user-facing changes?
No