Skip to content

Commit

Permalink
Add MatrixStats aggregation (#1631)
Browse files Browse the repository at this point in the history
  • Loading branch information
Telomeraz committed Apr 15, 2024
1 parent 6cfbbe1 commit 3564610
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 3564610

Please sign in to comment.