-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Better error message when buckets_path refers to multi-bucket agg #30152
Better error message when buckets_path refers to multi-bucket agg #30152
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
Pinging @elastic/es-search-aggs |
_bucket_count is a special case, since it returns a single value for a multi-bucket which is allowable.
@polyfractal I assume this is still something we want to get merged? Should we update the branch and find a reviewer? |
Urgh yes, forgot about this. Will get it updated and find a |
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. |
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. |
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 anymoreAggregatorTestCase
as #29641 so we can test pipelines easier.Closes #25273