Skip to content

Postfix operand parenthesization in ES|QL pretty printers - #220

Merged
bartoval merged 2 commits into
elastic:mainfrom
bartoval:postfix_operand_parens
Aug 13, 2026
Merged

Postfix operand parenthesization in ES|QL pretty printers#220
bartoval merged 2 commits into
elastic:mainfrom
bartoval:postfix_operand_parens

Conversation

@bartoval

Copy link
Copy Markdown
Contributor

Summary

I’m working on this, and I was thinking that I could extend the pretty printer’s behavior.
It already handles grouping for binary and prefix-unary expressions.

We extends the same support to postfix expressions such as IS NULL and IS NOT NULL, adding parentheses when required by the grammar.

(field IN (1, 2)) IS NULL

@bartoval bartoval self-assigned this Aug 13, 2026
@bartoval
bartoval requested a review from a team as a code owner August 13, 2026 13:55

@vadimkibana vadimkibana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@bartoval
bartoval merged commit aecd57f into elastic:main Aug 13, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 13, 2026
bartoval pushed a commit that referenced this pull request Aug 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @elastic/esql@4.19.2

### Patch Changes

- [#220](#220)
[`aecd57f`](aecd57f)
Thanks [@bartoval](https://github.com/bartoval)! - fix postfix operand
parenthesization in ES|QL pretty printers

- Updated dependencies []:
  - @elastic/esql-types@4.19.2
  - @elastic/esql-definitions@4.19.2
  - @elastic/esql-grammar@4.19.2
  - @elastic/esql-promql-grammar@4.19.2
  - @elastic/pretty-printer@4.19.2
  - @elastic/esql-traversal@4.19.2
  - @elastic/esql-ast@4.19.2
## @elastic/esql-ast@4.19.2

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-types@4.19.2
  - @elastic/esql-definitions@4.19.2
  - @elastic/esql-grammar@4.19.2
  - @elastic/esql-promql-grammar@4.19.2
## @elastic/elasticsearch-esql-dsl@4.19.2

### Patch Changes

- Updated dependencies []:
  - @elastic/elasticsearch-query-builder@4.19.2
## @elastic/esql-traversal@4.19.2

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-types@4.19.2
  - @elastic/esql-ast@4.19.2
## @elastic/monaco-esql@4.19.2

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.19.2
## @elastic/prismjs-esql@4.19.2

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.19.2
## @elastic/textmate-esql@4.19.2

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.19.2
## @elastic/esql-definitions@4.19.2


## @elastic/esql-grammar@4.19.2


## @elastic/esql-parser@4.19.2


## @elastic/esql-promql-grammar@4.19.2


## @elastic/esql-types@4.19.2


## @elastic/pretty-printer@4.19.2


## @elastic/elasticsearch-query-builder@4.19.2

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants