Skip to content
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] Add pretty-printing support for list literals #195383

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

vadimkibana
Copy link
Contributor

@vadimkibana vadimkibana commented Oct 8, 2024

Summary

Closes #194840

This PR add pretty-printing support for list literal expressions. For example, this query:

ROW ["..............................................", "..............................................", ".............................................."]

will be formatted as so:

ROW
  [
    "..............................................",
    "..............................................",
    ".............................................."]

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@vadimkibana vadimkibana requested a review from a team as a code owner October 8, 2024 11:15
@vadimkibana vadimkibana added review release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana v8.16.0 labels Oct 8, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #102 / Alerting alerts_as_data alerts as data flapping should allow rule specific flapping to override space flapping

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.4MB 3.4MB +364.0B

History

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice Vadim

@vadimkibana vadimkibana merged commit 4df2d9f into elastic:main Oct 10, 2024
25 checks passed
@vadimkibana vadimkibana deleted the pretty-lists-2 branch October 10, 2024 20:22
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11281419025

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 10, 2024
## Summary

Closes elastic#194840

This PR add pretty-printing support for list literal expressions. For
example, this query:

```
ROW ["..............................................", "..............................................", ".............................................."]
```

will be formatted as so:

```
ROW
  [
    "..............................................",
    "..............................................",
    ".............................................."]
```

### Checklist

Delete any items that are not applicable to this PR.

- [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
### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Stratoula Kalafateli <[email protected]>
(cherry picked from commit 4df2d9f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 10, 2024
…#195822)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Add pretty-printing support for list literals
(#195383)](#195383)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Vadim
Kibana","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-10T20:22:23Z","message":"[ES|QL]
Add pretty-printing support for list literals (#195383)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/194840\r\n\r\nThis PR add
pretty-printing support for list literal expressions. For\r\nexample,
this query:\r\n\r\n```\r\nROW
[\"..............................................\",
\"..............................................\",
\"..............................................\"]\r\n```\r\n\r\nwill
be formatted as so:\r\n\r\n```\r\nROW\r\n [\r\n
\"..............................................\",\r\n
\"..............................................\",\r\n
\"..............................................\"]\r\n```\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\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### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<[email protected]>","sha":"4df2d9f068445d3606a0cea58be6c32e00721d3f","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"[ES|QL]
Add pretty-printing support for list
literals","number":195383,"url":"https://github.com/elastic/kibana/pull/195383","mergeCommit":{"message":"[ES|QL]
Add pretty-printing support for list literals (#195383)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/194840\r\n\r\nThis PR add
pretty-printing support for list literal expressions. For\r\nexample,
this query:\r\n\r\n```\r\nROW
[\"..............................................\",
\"..............................................\",
\"..............................................\"]\r\n```\r\n\r\nwill
be formatted as so:\r\n\r\n```\r\nROW\r\n [\r\n
\"..............................................\",\r\n
\"..............................................\",\r\n
\"..............................................\"]\r\n```\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\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### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<[email protected]>","sha":"4df2d9f068445d3606a0cea58be6c32e00721d3f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195383","number":195383,"mergeCommit":{"message":"[ES|QL]
Add pretty-printing support for list literals (#195383)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/194840\r\n\r\nThis PR add
pretty-printing support for list literal expressions. For\r\nexample,
this query:\r\n\r\n```\r\nROW
[\"..............................................\",
\"..............................................\",
\"..............................................\"]\r\n```\r\n\r\nwill
be formatted as so:\r\n\r\n```\r\nROW\r\n [\r\n
\"..............................................\",\r\n
\"..............................................\",\r\n
\"..............................................\"]\r\n```\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\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### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<[email protected]>","sha":"4df2d9f068445d3606a0cea58be6c32e00721d3f"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Vadim Kibana <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes review Team:ESQL ES|QL related features in Kibana v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ES|QL] Add wrapping pretty-printing support for list literals
4 participants