def __init__(self, name, fields, post_aggregate_fn): # Stupid pydruid library uses old style classes Postaggregator.__init__(self, None, None, name) self.post_aggregator = { 'type': 'javascript', 'name': name, 'fieldNames': fields, 'function': post_aggregate_fn, }
def __init__(self, formula): # UGHHHH pydruid uses old-style classes. Postaggregator.__init__(self, None, None, 'expression') self.post_aggregator = {'type': 'expression', 'expression': formula}