Skip to content

Commit cea7179

Browse files
authored
Merge pull request #57 from spectriclabs/ColorByFix
ColorByFix
2 parents 2dd20f8 + fd391c4 commit cea7179

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

elastic_datashader/elastic.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

elastic_datashader/parameters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ def generate_global_params(headers, params, idx):
351351
global_doc_cnt = 0
352352

353353
bounds_s = copy.copy(base_s)
354-
bounds_s = bounds_s.params(size=0)
355354

356355
# We only need to do a global query if we are in span 'auto' or
357356
# using a numeric category

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ python = ">=3.10,<4"
2424
elasticsearch = "8.11.1"
2525
elasticsearch-dsl = "8.11.0"
2626
datashader = "0.16.0"
27-
pandas = "^1.5.3"
27+
pandas = "^2.0.0"
2828
colorcet = "^3.0.1"
2929
mercantile = "1.2.1"
3030
pypng = "*"
3131
Pillow = "*"
3232
pynumeral = "*"
3333
arrow = "*"
34+
pyarrow = "*"
3435
python-datemath = "*"
3536
numba = "0.57.1"
3637
numpy = "^1.23"

0 commit comments

Comments
 (0)