[ES|QL] improve function validation errors #180518
Labels
enhancement
New value added to drive a business result
Feature:ES|QL
ES|QL related features in Kibana
impact:medium
Addressing this issue will have a medium level of impact on the quality/strength of our product.
Team:ESQL
ES|QL related features in Kibana
WHEN I have typed a function invocation
AND there are no matching function signatures
THEN I expect to see helpful feedback and guidance
Explanation
Today, our validation errors for functions suffer from a few shortcomings like
These generally come down to the validation engine making assumptions about which call signature to use to generate the validation messages.
We should get less smart to get more smart. To do this, we should give the user as much relevant information as possible without being overwhelming.
Note: This is not only a user-facing enhancement. Making these errors more deterministic will result in a more maintainable validation test suite since we always assert against the error strings. It is a pain if they change without changing meaningfully.
Proposed algorithm
Examples
Given
func
has the following signaturesversion
number
,number
string
,string
boolean
,boolean
,boolean
The following invocations should generate the following approximate error messages
func(number)
"Expected func(version) but found func(number)."
func(version, version)
"Expected one of func(number, number), func(string, string) but found func(version, version)."
func()
"Expected one of func(version), func(number, number), func(string, string), or func(boolean, boolean, boolean) but found func(version, version)."
The text was updated successfully, but these errors were encountered: