From a6c93ef1144db3f72624c4c3f62ff2960d890187 Mon Sep 17 00:00:00 2001 From: Telomeraz Date: Sun, 16 Oct 2022 12:40:26 +0300 Subject: [PATCH] Add Geo-Line aggregation --- elasticsearch_dsl/aggs.py | 4 ++++ tests/test_aggs.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py index 61a27f3c4..11612fb39 100644 --- a/elasticsearch_dsl/aggs.py +++ b/elasticsearch_dsl/aggs.py @@ -329,6 +329,10 @@ class GeoBounds(Agg): name = "geo_bounds" +class GeoLine(Agg): + name = "geo_line" + + class Max(Agg): name = "max" diff --git a/tests/test_aggs.py b/tests/test_aggs.py index 327892862..16c2ad5f3 100644 --- a/tests/test_aggs.py +++ b/tests/test_aggs.py @@ -334,6 +334,17 @@ def test_t_test_aggregation(): } == a.to_dict() +def test_geo_line_aggregation(): + a = aggs.GeoLine(point={"field": "centroid"}, sort={"field": "date"}) + + assert { + "geo_line": { + "point": {"field": "centroid"}, + "sort": {"field": "date"}, + }, + } == a.to_dict() + + def test_inference_aggregation(): a = aggs.Inference(model_id="model-id", buckets_path={"agg_name": "agg_name"}) assert {