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

Add parsing method to GeoHashGrid aggregation #24589

Merged
merged 2 commits into from May 12, 2017

Conversation

Projects
None yet
3 participants
@tlrx
Member

tlrx commented May 10, 2017

This PR adds the parsing logic for the InternalGeoHashGrid aggregation.

@javanna

left a small comment, LGTM otherwise

if (geohashAsString != null) {
return GeoPoint.fromGeohash(geohashAsString);
}
return null;

This comment has been minimized.

@javanna

javanna May 10, 2017

Member

can it be null in practice?

This comment has been minimized.

@tlrx

tlrx May 11, 2017

Member

Not really, unless the key field was missing in the parsed XContent. I added the non null check just to avoid a NPE in this case.

This comment has been minimized.

@javanna

javanna May 11, 2017

Member

if it can happen only due to a bug, I would not handle it then. Rather make sure that it is always set through tests or assertions? Or even leave the NPE.

This comment has been minimized.

@tlrx

tlrx May 12, 2017

Member

I left the NPE

@javanna javanna requested a review from cbuescher May 10, 2017

@cbuescher

LGTM

@tlrx tlrx merged commit 29a5694 into elastic:feature/client_aggs_parsing May 12, 2017

1 check passed

CLA Commit author is a member of Elasticsearch
Details
@tlrx

This comment has been minimized.

Member

tlrx commented May 12, 2017

Thanks @javanna and @cbuescher !

@tlrx tlrx deleted the tlrx:add-parsing-for-geohashgrid-agg branch May 12, 2017

javanna added a commit to javanna/elasticsearch that referenced this pull request May 23, 2017

javanna added a commit to javanna/elasticsearch that referenced this pull request May 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment