[ES|QL] Unify matching signature detection#234665
Merged
drewdaemon merged 7 commits intoelastic:mainfrom Sep 11, 2025
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-esql (Team:ESQL) |
stratoula
approved these changes
Sep 11, 2025
Comment on lines
217
to
221
| if (expectedType === 'any') return true; | ||
|
|
||
| if (givenType === 'param') return true; | ||
|
|
||
| if (givenType === 'unknown') return acceptUnknown; |
Contributor
There was a problem hiding this comment.
Proposed change for readability:
if (expectedType === 'any' || givenType === 'param' || givenType === 'null') {
return true;
}
Contributor
There was a problem hiding this comment.
oh you just copied pasted it I see. It is a nit but it would need some readability improvements 😺
Contributor
Author
There was a problem hiding this comment.
lol actually this is what I had at first. I changed it so I could see code coverage reporting easier. Not a great reason to keep it that way. Will improve it!
Edit: I thought we were talking about different code
Contributor
Author
There was a problem hiding this comment.
Oh... I was too quick on the draw... I thought you were talking about different code... let me consider this suggestion
Contributor
💚 Build Succeeded
Metrics [docs]
History
|
15 tasks
KodeRad
pushed a commit
to KodeRad/kibana
that referenced
this pull request
Sep 15, 2025
## Summary Reliably getting a list of call signatures that match a function's arguments is a key operation used in both - Detecting if the arguments are valid (validation) - Detecting the return type of a function (expression type detection) I noticed that we had vastly improved this logic for validation in elastic#230139, but `getExpressionType` was still using a separate, inferior implementation, leading to bugs related to incorrect expression type detection. This PR extends the benefits of our improvements to expression type detection. ### Example bug #### Before <img width="493" height="227" alt="Screenshot 2025-09-10 at 11 15 54 AM" src="https://github.com/user-attachments/assets/69b4f544-be1f-4e8a-ba99-e3ace7d53e2b" /> _here `MV_SLICE` actually returns a keyword, but the expression evaluator says it returns a `date`_ #### After <img width="490" height="95" alt="Screenshot 2025-09-10 at 11 55 28 AM" src="https://github.com/user-attachments/assets/1dac9a9e-a690-4e63-b166-3f468513cedc" /> ### Checklist - [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
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this pull request
Sep 24, 2025
## Summary Reliably getting a list of call signatures that match a function's arguments is a key operation used in both - Detecting if the arguments are valid (validation) - Detecting the return type of a function (expression type detection) I noticed that we had vastly improved this logic for validation in elastic#230139, but `getExpressionType` was still using a separate, inferior implementation, leading to bugs related to incorrect expression type detection. This PR extends the benefits of our improvements to expression type detection. ### Example bug #### Before <img width="493" height="227" alt="Screenshot 2025-09-10 at 11 15 54 AM" src="https://github.com/user-attachments/assets/69b4f544-be1f-4e8a-ba99-e3ace7d53e2b" /> _here `MV_SLICE` actually returns a keyword, but the expression evaluator says it returns a `date`_ #### After <img width="490" height="95" alt="Screenshot 2025-09-10 at 11 55 28 AM" src="https://github.com/user-attachments/assets/1dac9a9e-a690-4e63-b166-3f468513cedc" /> ### Checklist - [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
niros1
pushed a commit
that referenced
this pull request
Sep 30, 2025
## Summary Reliably getting a list of call signatures that match a function's arguments is a key operation used in both - Detecting if the arguments are valid (validation) - Detecting the return type of a function (expression type detection) I noticed that we had vastly improved this logic for validation in #230139, but `getExpressionType` was still using a separate, inferior implementation, leading to bugs related to incorrect expression type detection. This PR extends the benefits of our improvements to expression type detection. ### Example bug #### Before <img width="493" height="227" alt="Screenshot 2025-09-10 at 11 15 54 AM" src="https://github.com/user-attachments/assets/69b4f544-be1f-4e8a-ba99-e3ace7d53e2b" /> _here `MV_SLICE` actually returns a keyword, but the expression evaluator says it returns a `date`_ #### After <img width="490" height="95" alt="Screenshot 2025-09-10 at 11 55 28 AM" src="https://github.com/user-attachments/assets/1dac9a9e-a690-4e63-b166-3f468513cedc" /> ### Checklist - [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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reliably getting a list of call signatures that match a function's arguments is a key operation used in both
I noticed that we had vastly improved this logic for validation in #230139, but
getExpressionTypewas still using a separate, inferior implementation, leading to bugs related to incorrect expression type detection.This PR extends the benefits of our improvements to expression type detection.
Example bug
Before
here
MV_SLICEactually returns a keyword, but the expression evaluator says it returns adateAfter
Checklist