-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ES|QL] treat time_duration and date_period separately
#230276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ES|QL] treat time_duration and date_period separately
#230276
Conversation
| evalExpectErrors(`from a_index | eval col0 = dateField - 1 ${unit.toUpperCase()}`, []); | ||
| evalExpectErrors(`from a_index | eval col0 = dateField - 1 ${capitalize(unit)}`, []); | ||
| evalExpectErrors(`from a_index | eval col0 = dateField + 1 ${unit}`, []); | ||
| evalExpectErrors(`from a_index | eval 1 ${unit} + 1 year`, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool... with the old logic, we were incorrectly allowing this case. But now that we've tightened up the typing, the validator correctly flagged it based on the + function definition
| }); | ||
| }); | ||
|
|
||
| describe('time interval', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer a special case!
time_duration and date_period correctlytime_duration and date_period separately
|
Pinging @elastic/kibana-esql (Team:ESQL) |
stratoula
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, code review only!
|
@elasticmachine merge upstream |
jgowdyelastic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
|
…30276) ## Summary Closes elastic#223037 The main change here is changing the "timeInterval" AST item to be two types of new literal items that share mostly the same structure as the other literals and no longer require special handling during validation! A few validation checks around these were also removed. More about that in the comments. ### 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 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…30276) ## Summary Closes elastic#223037 The main change here is changing the "timeInterval" AST item to be two types of new literal items that share mostly the same structure as the other literals and no longer require special handling during validation! A few validation checks around these were also removed. More about that in the comments. ### 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 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Closes #223037
The main change here is changing the "timeInterval" AST item to be two types of new literal items that share mostly the same structure as the other literals and no longer require special handling during validation!
A few validation checks around these were also removed. More about that in the comments.
Checklist