druid-io / pydruid

A Python connector for Druid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

time_boundary query: Discrepancy between Druid functionality and PyDruid

sebtrack opened this issue · comments

According to the docs, there are more valid properties than datasource only:

{
    "queryType" : "timeBoundary",
    "dataSource": "sample_datasource",
    "bound"     : < "maxTime" | "minTime" > # optional, defaults to returning both timestamps if not set
    "filter"    : { "type": "and", "fields": [<filter>, <filter>, ...] } # optional
}

pydruid/pydruid/query.py

Lines 441 to 453 in 98cab4d

def time_boundary(self, args):
"""
A time boundary query returns the min and max timestamps present in a data source.
:param dict args: dict of args
:return: time boundary query
:rtype: Query
"""
query_type = "timeBoundary"
valid_parts = ["datasource"]
self.validate_query(query_type, valid_parts, args)
return self.build_query(query_type, args)

I guess, since bound and filter are optional, these are not taken into consideration when validating the query