@@ -220,6 +220,7 @@ def test_filters_correctly_identifies_the_hash() -> None:
220220
221221
222222def test_bucket_sort_agg () -> None :
223+ # test the dictionary (type ignored) and fully typed alterantives
223224 bucket_sort_agg = aggs .BucketSort (sort = [{"total_sales" : {"order" : "desc" }}], size = 3 ) # type: ignore
224225 assert bucket_sort_agg .to_dict () == {
225226 "bucket_sort" : {"sort" : [{"total_sales" : {"order" : "desc" }}], "size" : 3 }
@@ -251,6 +252,7 @@ def test_bucket_sort_agg() -> None:
251252
252253
253254def test_bucket_sort_agg_only_trnunc () -> None :
255+ # test the dictionary (type ignored) and fully typed alterantives
254256 bucket_sort_agg = aggs .BucketSort (** {"from" : 1 , "size" : 1 , "_expand__to_dot" : False }) # type: ignore
255257 assert bucket_sort_agg .to_dict () == {"bucket_sort" : {"from" : 1 , "size" : 1 }}
256258 bucket_sort_agg = aggs .BucketSort (from_ = 1 , size = 1 , _expand__to_dot = False )
@@ -265,20 +267,23 @@ def test_bucket_sort_agg_only_trnunc() -> None:
265267
266268
267269def test_geohash_grid_aggregation () -> None :
270+ # test the dictionary (type ignored) and fully typed alterantives
268271 a = aggs .GeohashGrid (** {"field" : "centroid" , "precision" : 3 }) # type: ignore
269272 assert {"geohash_grid" : {"field" : "centroid" , "precision" : 3 }} == a .to_dict ()
270273 a = aggs .GeohashGrid (field = "centroid" , precision = 3 )
271274 assert {"geohash_grid" : {"field" : "centroid" , "precision" : 3 }} == a .to_dict ()
272275
273276
274277def test_geohex_grid_aggregation () -> None :
278+ # test the dictionary (type ignored) and fully typed alterantives
275279 a = aggs .GeohexGrid (** {"field" : "centroid" , "precision" : 3 }) # type: ignore
276280 assert {"geohex_grid" : {"field" : "centroid" , "precision" : 3 }} == a .to_dict ()
277281 a = aggs .GeohexGrid (field = "centroid" , precision = 3 )
278282 assert {"geohex_grid" : {"field" : "centroid" , "precision" : 3 }} == a .to_dict ()
279283
280284
281285def test_geotile_grid_aggregation () -> None :
286+ # test the dictionary (type ignored) and fully typed alterantives
282287 a = aggs .GeotileGrid (** {"field" : "centroid" , "precision" : 3 }) # type: ignore
283288 assert {"geotile_grid" : {"field" : "centroid" , "precision" : 3 }} == a .to_dict ()
284289 a = aggs .GeotileGrid (field = "centroid" , precision = 3 )
@@ -318,6 +323,7 @@ def test_variable_width_histogram_aggregation() -> None:
318323
319324
320325def test_ip_prefix_aggregation () -> None :
326+ # test the dictionary (type ignored) and fully typed alterantives
321327 a = aggs .IPPrefix (** {"field" : "ipv4" , "prefix_length" : 24 }) # type: ignore
322328 assert {"ip_prefix" : {"field" : "ipv4" , "prefix_length" : 24 }} == a .to_dict ()
323329 a = aggs .IPPrefix (field = "ipv4" , prefix_length = 24 )
@@ -501,6 +507,7 @@ def test_adjancecy_matrix_aggregation() -> None:
501507
502508
503509def test_top_metrics_aggregation () -> None :
510+ # test the dictionary (type ignored) and fully typed alterantives
504511 a = aggs .TopMetrics (metrics = {"field" : "m" }, sort = {"s" : "desc" }) # type: ignore
505512 assert {
506513 "top_metrics" : {"metrics" : {"field" : "m" }, "sort" : {"s" : "desc" }}
0 commit comments