Implement running scheduled rules and check aggregations
This commit is contained in:
@@ -58,7 +58,7 @@ def annotate_results(results):
|
||||
item["num_chans"] = num_chans[item["nick"]]
|
||||
|
||||
|
||||
def parse_results(results):
|
||||
def parse_results(results, aggs):
|
||||
results_parsed = []
|
||||
stringify = ["host", "channel"]
|
||||
if "hits" in results.keys():
|
||||
@@ -110,6 +110,14 @@ def parse_results(results):
|
||||
else:
|
||||
element["time"] = time
|
||||
results_parsed.append(element)
|
||||
if aggs:
|
||||
aggregations = {}
|
||||
if "aggregations" in results:
|
||||
for field in ["avg_sentiment"]: # Add other number fields here
|
||||
if field in results["aggregations"]:
|
||||
aggregations[field] = results["aggregations"][field]
|
||||
return (aggregations, results_parsed)
|
||||
|
||||
return results_parsed
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user