@@ -35,13 +35,13 @@ def scan(search, use_scroll=False, size=10000):
3535 search = search .sort ("_doc" )
3636 if use_scroll :
3737 for hit in search .scan ():
38- yield from hit
38+ yield hit
3939 else :
4040 _search = search .params (size = size ).extra (track_total_hits = False )
4141 while _search is not None :
4242 hit = None
4343 for hit in _search :
44- yield from hit
44+ yield hit
4545 if hit is not None :
4646 _search = search .extra (search_after = list (hit .meta .sort ))
4747 else :
@@ -379,10 +379,9 @@ def convert_composite(response, categorical, filter_buckets, histogram_interval,
379379 if categorical and filter_buckets is False :
380380 # Convert a regular terms aggregation
381381 for bucket in response :
382+ lon , lat = geotile_bucket_to_lonlat (bucket )
383+ x , y = lnglat_to_meters (lon , lat )
382384 for category in bucket .categories :
383- lon , lat = geotile_bucket_to_lonlat (bucket )
384- x , y = lnglat_to_meters (lon , lat )
385-
386385 raw = category .key
387386 # Bin the data
388387 if histogram_interval is not None :
@@ -406,12 +405,11 @@ def convert_composite(response, categorical, filter_buckets, histogram_interval,
406405 elif categorical and filter_buckets is True :
407406 # Convert a filter bucket aggregation
408407 for bucket in response :
408+ lon , lat = geotile_bucket_to_lonlat (bucket )
409+ x , y = lnglat_to_meters (lon , lat )
409410 for key in bucket .categories .buckets :
410411 category = bucket .categories .buckets [key ]
411412 if category .doc_count > 0 :
412- lon , lat = geotile_bucket_to_lonlat (bucket )
413- x , y = lnglat_to_meters (lon , lat )
414-
415413 if category_type == "number" :
416414 try :
417415 label = pynumeral .format (to_32bit_float (key ), category_format )
@@ -597,7 +595,7 @@ def run_search(**kwargs):
597595
598596 while response .aggregations .comp .buckets :
599597 for b in response .aggregations .comp .buckets :
600- yield from b
598+ yield b
601599 if "after_key" in response .aggregations .comp :
602600 after = response .aggregations .comp .after_key
603601 else :
0 commit comments