diff --git a/lambda/recovered/__init__.py b/lambda/recovered/__init__.py index a2c6620..397ae21 100644 --- a/lambda/recovered/__init__.py +++ b/lambda/recovered/__init__.py @@ -345,7 +345,7 @@ def stats(event, context): "order": { "recovered_by": "desc" }, - "size": 5 + "size": 6 }, "aggs": { "recovered_by": { @@ -393,6 +393,8 @@ def stats(event, context): try: output['top_chasers'] = { x['key'] : x['recovered_by']['value'] for x in results['aggregations']['top_recovered']['buckets']} + if "" in output['top_chasers']: + del output['top_chasers'][""] except: pass diff --git a/lambda/recovered/__main__.py b/lambda/recovered/__main__.py index fc6a539..e0794ee 100644 --- a/lambda/recovered/__main__.py +++ b/lambda/recovered/__main__.py @@ -46,16 +46,17 @@ payload = { "timeEpoch": 1612051825409, }, "body": json.dumps({ - "datetime": "2021-06-06T01:10:07.629Z", - "serial": "S4631407", - "lat": 0, - "lon": 0, - "alt": 0, - "recovered": True, - "recovered_by": "string", - "description": "string" + # "datetime": "2021-06-06T01:10:07.629Z", + # "serial": "S4631407", + # "lat": 0, + # "lon": 0, + # "alt": 0, + # "recovered": True, + # "recovered_by": "string", + # "description": "string" }), "isBase64Encoded": False, } # print(put(payload, {})) -print(get(payload, {})) \ No newline at end of file +#print(get(payload, {})) +print(stats(payload, {})) \ No newline at end of file