Better error message when buckets_path refers to multi-bucket agg #30152
Closed
polyfractal wants to merge 7 commits intoelastic:masterfrom
Closed
Better error message when buckets_path refers to multi-bucket agg #30152polyfractal wants to merge 7 commits intoelastic:masterfrom
polyfractal wants to merge 7 commits intoelastic:masterfrom
Conversation
Instead of throwing a technical error (`found Object[]`), we can check to see if any of the referenced aggs are a multi-bucket agg and throw a friendlier exception. Closes elastic#25273
Collaborator
|
Pinging @elastic/es-search-aggs |
_bucket_count is a special case, since it returns a single value for a multi-bucket which is allowable.
Contributor
|
@polyfractal I assume this is still something we want to get merged? Should we update the branch and find a reviewer? |
Contributor
Author
|
Urgh yes, forgot about this. Will get it updated and find a |
Contributor
Author
|
Hmm, I'm looking at this again and I don't really like how it was implemented. I'll carve out some time to re-examine the issue and see if it can be fixed a different way that doesn't need to change the method signatures. Just feels like a lot of complication for a nicer error message. |
Contributor
Author
|
Closing for now. I've decided I don't like the implementation, and don't think there's a need to keep this PR pending/stalled while (or if) I think about a better way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of throwing a technical error when the user specifies a pipeline agg path that includes a multi-bucket, we can check during the property resolution and throw a friendlier exception
The old exception:
Compared to the new exceptions:
I'm not super pleased with how this was implemented, adding a boolean to
getProperty(). But it seemed the least invasive way. In particular because we have to deal with both multi-buckets and numeric aggs that have multiple values.Note: this uses the same changes toNot relevant anymoreAggregatorTestCaseas #29641 so we can test pipelines easier.Closes #25273