Skip to content

Commit da13b4f

Browse files
author
Eric Christensen
committed
Making some updates that allowed for returning tiles with a group by.
1 parent 2dd20f8 commit da13b4f

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

elastic_datashader/elastic.py

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