mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[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:
parent
1b90076047
commit
28277c25df
2 changed files with 5 additions and 5 deletions
|
@ -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")`,
|
||||
|
|
|
@ -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
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue