-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Fix some validation misconfiguration #177783
[ES|QL] Fix some validation misconfiguration #177783
Conversation
/ci |
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
/ci |
We have till the 13th of March, why not fix it here? It is related with the bug you are trying to fix in this PR |
/ci |
/ci |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
testSuggestions( | ||
`from a_index | eval round(numberField) + 1 | eval \`round(numberField) + 1\` + 1 | eval \`\`\`round(numberField) + 1\`\` + 1\` + 1 | eval \`\`\`\`\`\`\`round(numberField) + 1\`\`\`\` + 1\`\` + 1\` + 1 | eval \`\`\`\`\`\`\`\`\`\`\`\`\`\`\`round(numberField) + 1\`\`\`\`\`\`\`\` + 1\`\`\`\` + 1\`\` + 1\` + 1 | ${command} `, | ||
[ | ||
...getFieldNamesByType('any'), |
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.
😄
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.
Works great now! LGTM!
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Related issue elastic#177699 Fix variables logic for expressions at `stats by ...` level. Fix validation logic for agg functions within `eval` or `where` scope. Fix validation and autocomplete logic for nested quoted expressions * i.e. ``` from index | eval round(numberField) + 1 | eval `round(numberField) + 1` + 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval ```````round(numberField) + 1```` + 1`` + 1` + 1 | eval ```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 | keep ```````````````````````````````round(numberField) + 1```````````````` + 1```````` + 1```` + 1`` + 1` ``` * updated `count_distinct` agg definition to have the `precision` second optional param. ### 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: Stratoula Kalafateli <[email protected]> (cherry picked from commit cad276f) # Conflicts: # packages/kbn-monaco/src/esql/lib/ast/validation/esql_validation_meta_tests.json
# Backport This will backport the following commits from `main` to `8.13`: - [[ES|QL] Fix some validation misconfiguration (#177783)](#177783) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Liberati","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-03-07T12:57:27Z","message":"[ES|QL] Fix some validation misconfiguration (#177783)\n\n## Summary\r\n\r\nRelated issue #177699\r\n\r\nFix variables logic for expressions at `stats by ...` level.\r\nFix validation logic for agg functions within `eval` or `where` scope.\r\nFix validation and autocomplete logic for nested quoted expressions\r\n * i.e. \r\n ```\r\nfrom index | eval round(numberField) + 1 | eval `round(numberField) + 1`\r\n+ 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval\r\n```````round(numberField) + 1```` + 1`` + 1` + 1 | eval\r\n```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 |\r\nkeep ```````````````````````````````round(numberField) +\r\n1```````````````` + 1```````` + 1```` + 1`` + 1`\r\n ```\r\n* updated `count_distinct` agg definition to have the `precision` second\r\noptional param.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"cad276fcbd9fe5b13c18f08fd01bcf0c802b7ec9","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","backport:prev-minor","Feature:ES|QL","v8.13.0","v8.14.0"],"number":177783,"url":"https://github.com/elastic/kibana/pull/177783","mergeCommit":{"message":"[ES|QL] Fix some validation misconfiguration (#177783)\n\n## Summary\r\n\r\nRelated issue #177699\r\n\r\nFix variables logic for expressions at `stats by ...` level.\r\nFix validation logic for agg functions within `eval` or `where` scope.\r\nFix validation and autocomplete logic for nested quoted expressions\r\n * i.e. \r\n ```\r\nfrom index | eval round(numberField) + 1 | eval `round(numberField) + 1`\r\n+ 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval\r\n```````round(numberField) + 1```` + 1`` + 1` + 1 | eval\r\n```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 |\r\nkeep ```````````````````````````````round(numberField) +\r\n1```````````````` + 1```````` + 1```` + 1`` + 1`\r\n ```\r\n* updated `count_distinct` agg definition to have the `precision` second\r\noptional param.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"cad276fcbd9fe5b13c18f08fd01bcf0c802b7ec9"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177783","number":177783,"mergeCommit":{"message":"[ES|QL] Fix some validation misconfiguration (#177783)\n\n## Summary\r\n\r\nRelated issue #177699\r\n\r\nFix variables logic for expressions at `stats by ...` level.\r\nFix validation logic for agg functions within `eval` or `where` scope.\r\nFix validation and autocomplete logic for nested quoted expressions\r\n * i.e. \r\n ```\r\nfrom index | eval round(numberField) + 1 | eval `round(numberField) + 1`\r\n+ 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval\r\n```````round(numberField) + 1```` + 1`` + 1` + 1 | eval\r\n```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 |\r\nkeep ```````````````````````````````round(numberField) +\r\n1```````````````` + 1```````` + 1```` + 1`` + 1`\r\n ```\r\n* updated `count_distinct` agg definition to have the `precision` second\r\noptional param.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"cad276fcbd9fe5b13c18f08fd01bcf0c802b7ec9"}}]}] BACKPORT--> Co-authored-by: Marco Liberati <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
This PR didn't make it into the latest BC. Updating the labels. |
Summary
Related issue #177699
Fix variables logic for expressions at
stats by ...
level.Fix validation logic for agg functions within
eval
orwhere
scope.Fix validation and autocomplete logic for nested quoted expressions
count_distinct
agg definition to have theprecision
second optional param.Checklist