Skip to content

Conversation

cbuescher
Copy link
Member

Most aggregations inheriting from AggregatorBase implement 'toString()' by
printing the name of the aggregation, but AdaptingAggregator and subclasses
don't, so they will print Object#toString(). In some tests where we e.g. compare
response json outputs for equality this can cause errors because two separate
instances will have different string representations. This changes fixes that by
also using the name of the aggregation here.

Relates to #85538

Most aggregations inheriting from AggregatorBase implement 'toString()' by
printing the name of the aggregation, but AdaptingAggregator and subclasses
don't, so they will print Object#toString(). In some tests where we e.g. compare
response json outputs for equality this can cause errors because two separate
instances will have different string representations. This changes fixes that by
also using the name of the aggregation here.
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 20, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @cbuescher, I've created a changelog YAML for you.

@cbuescher
Copy link
Member Author

See #85538 (comment) for an example how this can cause a problem in our tests.

@nik9000 nik9000 self-requested a review April 20, 2022 17:41
@cbuescher
Copy link
Member Author

@nik thanks for the review

@elasticsearchmachine
Copy link
Collaborator

Hi @cbuescher, I've created a changelog YAML for you.

@cbuescher cbuescher closed this Apr 21, 2022
@cbuescher cbuescher reopened this Apr 21, 2022
@cbuescher cbuescher merged commit f06dafa into elastic:master Apr 21, 2022
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Apr 21, 2022
Most aggregations inheriting from AggregatorBase implement 'toString()' by
printing the name of the aggregation, but AdaptingAggregator and subclasses
don't, so they will print Object#toString(). In some tests where we e.g. compare
response json outputs for equality this can cause errors because two separate
instances will have different string representations. This changes fixes that by
also using the name of the aggregation here.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.2

elasticsearchmachine pushed a commit that referenced this pull request Apr 21, 2022
Most aggregations inheriting from AggregatorBase implement 'toString()' by
printing the name of the aggregation, but AdaptingAggregator and subclasses
don't, so they will print Object#toString(). In some tests where we e.g. compare
response json outputs for equality this can cause errors because two separate
instances will have different string representations. This changes fixes that by
also using the name of the aggregation here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.2.1 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants