forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ES|QL] Improve handling of functions for variadic signatures with mi…
…nParams (elastic#177165) ## Summary Fix an issue with functions with the `minParams` configuration (`concat`, `case`, `cidr_match`). Validation fix: * now validation engine understands the minimum number of args and provide a better message based on the function signature * if the function has a single exact signature, then make it explicit the `exact` nature <img width="442" alt="Screenshot 2024-02-19 at 11 46 59" src="https://github.com/elastic/kibana/assets/924948/14aa9cb4-bce2-404b-936e-cb92ec966c2d"> <img width="227" alt="Screenshot 2024-02-19 at 11 45 18" src="https://github.com/elastic/kibana/assets/924948/94b2a051-5cd2-4f60-b65a-c3ac77c17b85"> * if the function has some optional args in the signature, then make it explicit that there are too few or too many args <img width="441" alt="Screenshot 2024-02-19 at 11 48 00" src="https://github.com/elastic/kibana/assets/924948/55acf5f7-ce6b-452d-ba49-cd38ac05120e"> <img width="443" alt="Screenshot 2024-02-19 at 11 45 03" src="https://github.com/elastic/kibana/assets/924948/653f62d3-7ee5-44d2-91e9-aae812f08394"> * if the function has a minParams configuration, then it should make it explicit that there are too few args: <img width="467" alt="Screenshot 2024-02-19 at 11 41 46" src="https://github.com/elastic/kibana/assets/924948/8a4030e0-317d-4371-abd0-11b333ad26d9"> <img width="441" alt="Screenshot 2024-02-19 at 11 41 16" src="https://github.com/elastic/kibana/assets/924948/d8f8048e-edda-44c2-b84e-b908cd7b29a5"> <img width="446" alt="Screenshot 2024-02-19 at 11 41 04" src="https://github.com/elastic/kibana/assets/924948/c6ac58ef-a1b7-48a6-b2ad-a8994ae2b885"> * autocomplete now understand the `minParams` and suggest the right value in the right place ![esql_min_params_autocomplete](https://github.com/elastic/kibana/assets/924948/fd21a819-8310-4f94-88e6-3a2967c7a8bd) * signature hover tooltip now provides a better signature for functions with minParams (arg should not be optional, rather mandatory until the #minParams, optional after) ![esql_min_params_signature](https://github.com/elastic/kibana/assets/924948/421f22f3-8d00-4acb-a65c-495a05b8d400) ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
9 changed files
with
277 additions
and
102 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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.