Skip to content

Commit 74c5f7b

Browse files
Add MatrixStats aggregation (#1631) (#1798)
(cherry picked from commit 3564610) Co-authored-by: Hüseyin Emre Armağan <[email protected]>
1 parent 6583c22 commit 74c5f7b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

elasticsearch_dsl/aggs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ class Max(Agg):
333333
name = "max"
334334

335335

336+
class MatrixStats(Agg):
337+
name = "matrix_stats"
338+
339+
336340
class MedianAbsoluteDeviation(Agg):
337341
name = "median_absolute_deviation"
338342

tests/test_aggs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ def test_inference_aggregation():
341341
} == a.to_dict()
342342

343343

344+
def test_matrix_stats_aggregation():
345+
a = aggs.MatrixStats(fields=["poverty", "income"])
346+
347+
assert {"matrix_stats": {"fields": ["poverty", "income"]}} == a.to_dict()
348+
349+
344350
def test_moving_percentiles_aggregation():
345351
a = aggs.DateHistogram()
346352
a.bucket("the_percentile", "percentiles", field="price", percents=[1.0, 99.0])

0 commit comments

Comments
 (0)