Skip to content

Commit

Permalink
documented time_boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Deep Ganguli committed Mar 4, 2014
1 parent 9f595df commit 69e9784
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pydruid/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,25 @@ def segment_metadata(self, **kwargs):
return self.post(self.query_dict)

def time_boundary(self, **kwargs):
"""
A time boundary query returns the min and max timestamps present in a data source.
Required key/value pairs:
:param str datasource: Data source to query
:return: The query result
:rtype: list[dict]
Example:
.. code-block:: python
:linenos:
>>> bound = query.time_boundary(datasource='twitterstream')
>>> print bound
>>> [{'timestamp': '2011-09-14T15:00:00.000Z', 'result': {'minTime': '2011-09-14T15:00:00.000Z', 'maxTime': '2014-03-04T23:44:00.000Z'}}]
"""
self.query_type = 'timeBoundary'
valid_parts = ['datasource']
self.__validate_query(valid_parts, kwargs)
Expand Down

0 comments on commit 69e9784

Please sign in to comment.