-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix StringIndexOutOfBoundsException in COMPLETION command when options are omitted. #138363
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
Fix StringIndexOutOfBoundsException in COMPLETION command when options are omitted. #138363
Conversation
…al parameters omitted
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
|
Hi @afoucret, I've created a changelog YAML for you. |
| } | ||
|
|
||
| Map<String, Expression> optionsMap = visitCommandNamedParameters(ctx).keyFoldedMap(); | ||
| Map<String, Expression> optionsMap = optionsExpression.keyFoldedMap(); |
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.
ℹ️ For whatever reason (abuse of pizzas?) I was not reusing the optionExpression while it was the right things to do.
| // completely change the syntax in the future. | ||
| throw new ParsingException(source(ctx), "Missing mandatory option [{}] in COMPLETION", Completion.INFERENCE_ID_OPTION_NAME); | ||
| throw new ParsingException( | ||
| completion.source(), |
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.
ℹ️ Using completion.source instead of source(ctx). Avoid StringIndexOutOfBoundsException that were cause when options were missing (ctx is null)
kderusso
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
…s are omitted. (elastic#138363) Fix yaml
…s are omitted. (elastic#138363) Fix yaml
Fixes #138361