[ES|QL] case only requires two parameters (#179011)

## Summary

Part of https://github.com/elastic/kibana/issues/177699

We had `case` marked as if it required three parameters when in reality
it only requires two.

<img width="600" alt="Screenshot 2024-03-19 at 4 23 29 PM"
src="45f7578a-e6ad-4ba9-b71a-05bb1978a384">

Note: we could consider testing these n-1 cases to prevent this kind of
bug in the future.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
This commit is contained in:
Drew Tate 2024-03-21 15:34:38 +01:00 committed by GitHub
parent 1b90076047
commit 28277c25df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -592,7 +592,7 @@ export const evalFunctionsDefinitions: FunctionDefinition[] = [
{ name: 'condition', type: 'boolean' },
{ name: 'value', type: 'any' },
],
minParams: 3,
minParams: 2,
returnType: 'any',
examples: [
`from index | eval type = case(languages <= 1, "monolingual", languages <= 2, "bilingual", "polyglot")`,

View file

@ -563,11 +563,11 @@
"error": false
},
{
"query": "row var = case(true, \"a\", \"a\")",
"query": "row var = case(true, \"a\")",
"error": false
},
{
"query": "row case(true, \"a\", \"a\")",
"query": "row case(true, \"a\")",
"error": false
},
{
@ -4871,11 +4871,11 @@
"error": true
},
{
"query": "from a_index | eval var = case(booleanField, stringField, stringField)",
"query": "from a_index | eval var = case(booleanField, stringField)",
"error": false
},
{
"query": "from a_index | eval case(booleanField, stringField, stringField)",
"query": "from a_index | eval case(booleanField, stringField)",
"error": false
},
{