From 60492c348bb38ce1480a5af04b3e5bfcc38ae7b0 Mon Sep 17 00:00:00 2001 From: Martin Lie Date: Mon, 21 Sep 2020 08:05:00 +0200 Subject: [PATCH 1/2] Added imports as per community tips --- pydruid/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pydruid/client.py b/pydruid/client.py index ae51eab7..99aaf830 100755 --- a/pydruid/client.py +++ b/pydruid/client.py @@ -16,6 +16,8 @@ import json import re import urllib +import urllib.error +import urllib.request from base64 import b64encode from pydruid.query import QueryBuilder From ead6a3e5c3f3b0b242f3fc9fd3e21914f54ad7fa Mon Sep 17 00:00:00 2001 From: CasperAmandusJohansen404 Date: Wed, 28 Oct 2020 09:07:44 +0100 Subject: [PATCH 2/2] Added first and last aggregators to utils --- pydruid/utils/aggregators.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pydruid/utils/aggregators.py b/pydruid/utils/aggregators.py index 23caa826..697b8fb5 100644 --- a/pydruid/utils/aggregators.py +++ b/pydruid/utils/aggregators.py @@ -62,6 +62,11 @@ def doublemin(raw_metric): def doublemax(raw_metric): return {"type": "doubleMax", "fieldName": raw_metric} +def doublelast(raw_metric): + return {"type": "doubleLast", "fieldName": raw_metric} + +def doublefirst(raw_metric): + return {"type": "doubleFirst", "fieldName": raw_metric} def count(raw_metric): return {"type": "count", "fieldName": raw_metric}