-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: Attach Diagnostic to "function x does not exist" error #14849
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
Conversation
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.
Looks great!
datafusion/sql/src/expr/function.rs
Outdated
let mut diagnostic = | ||
Diagnostic::new_error(format!("Invalid function '{name}'"), span); | ||
diagnostic.add_note( | ||
format!("possible function {}", suggested_func_name), |
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.
Perhaps this should be uppercase? Considering it's a message seen by an end user and not a programmatically consumed string.
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.
sure
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.
delivered in 8441bb8
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 @onlyjackfrost and @eliaperantoni
I think @eliaperantoni 's suggestion about message is a good one, but otherwise this one looks good to go to me
🚀 -- thanks again @onlyjackfrost and @eliaperantoni |
Which issue does this PR close?
Diagnostic
to "function x does not exist" error #14430Rationale for this change
well explained in the issue.
What changes are included in this PR?
This PR attaches
Diagnostic
with the "function x does not exist" error.Get the span of function from sql-parser, then attach to Diagnostic after transformation.
Are these changes tested?
yes, unit test was added.