-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Prevent instantiation of top_metrics when sub-aggregations are present #96180
Prevent instantiation of top_metrics when sub-aggregations are present #96180
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
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.
Thanks! could you please remove the overrided method #subAggregation(AggregationBuilder aggregation) as it is not needed. After that we can merge the change.
|
||
@Override | ||
public TopMetricsAggregationBuilder subAggregation(AggregationBuilder aggregation) { | ||
throw new AggregationInitializationException( |
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.
I think this is not needed and can be removed.
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.
Thanks, updated
@elasticmachine test this please |
1 similar comment
@elasticmachine test this please |
Forgot to update test, fixing now |
@elasticmachine test this please |
@elasticmachine test this please |
Currently fixing an issue with my local build so I can run |
@elasticmachine test this please |
I think you cannot tag the bot, it is too clever. |
@elasticmachine run elasticsearch-ci/part-1 |
@elasticmachine update branch |
@elasticmachine test this please |
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
Thank you for the contribution @shans96! |
Took inspiration from some of the other inheritors of
AbstractAggregationBuilder
to fix this bug, although I'm not sure if I need to override any of the othersubAggregation
methods inside the top metrics builder to completely fix the issue.I was also wondering if there's a way to make use of the existing
createTestInstance
method to reduce the size of the new test, but it doesn't seem like I can use it because I need to set the aggregator name in advance.Closes #95663