Skip to content

Commit

Permalink
Add MatrixStats aggregation (#1631) (#1798)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3564610)

Co-authored-by: Hüseyin Emre Armağan <[email protected]>
  • Loading branch information
github-actions[bot] and Telomeraz authored Apr 29, 2024
1 parent 6583c22 commit 74c5f7b
Show file tree
Hide file tree
Showing 2 changed files with 10 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 @@ -333,6 +333,10 @@ class Max(Agg):
name = "max"


class MatrixStats(Agg):
name = "matrix_stats"


class MedianAbsoluteDeviation(Agg):
name = "median_absolute_deviation"

Expand Down
6 changes: 6 additions & 0 deletions tests/test_aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ def test_inference_aggregation():
} == a.to_dict()


def test_matrix_stats_aggregation():
a = aggs.MatrixStats(fields=["poverty", "income"])

assert {"matrix_stats": {"fields": ["poverty", "income"]}} == a.to_dict()


def test_moving_percentiles_aggregation():
a = aggs.DateHistogram()
a.bucket("the_percentile", "percentiles", field="price", percents=[1.0, 99.0])
Expand Down

0 comments on commit 74c5f7b

Please sign in to comment.