Skip to content

Commit

Permalink
Add Geo-Line aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
Telomeraz authored and miguelgrinberg committed Apr 15, 2024
1 parent 3564610 commit a6c93ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elasticsearch_dsl/aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ class GeoBounds(Agg):
name = "geo_bounds"


class GeoLine(Agg):
name = "geo_line"


class Max(Agg):
name = "max"

Expand Down
11 changes: 11 additions & 0 deletions tests/test_aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a6c93ef

Please sign in to comment.