diff --git a/caravel/models.py b/caravel/models.py index 55e79981ed27e..8df21670d4fef 100644 --- a/caravel/models.py +++ b/caravel/models.py @@ -1869,7 +1869,8 @@ def query( # druid """ # TODO refactor into using a TBD Query object qry_start_dttm = datetime.now() - + if not is_timeseries: + granularity = 'all' inner_from_dttm = inner_from_dttm or from_dttm inner_to_dttm = inner_to_dttm or to_dttm @@ -1957,10 +1958,10 @@ def recursive_get_fields(_conf): del qry['dimensions'] client.timeseries(**qry) if len(groupby) == 1: - if not timeseries_limit: - timeseries_limit = 1000 - qry['threshold'] = timeseries_limit + qry['threshold'] = timeseries_limit or 1000 + if row_limit and granularity == 'all': + qry['threshold'] = row_limit qry['dimension'] = list(qry.get('dimensions'))[0] del qry['dimensions'] qry['metric'] = list(qry['aggregations'].keys())[0] diff --git a/caravel/viz.py b/caravel/viz.py index 0b2add43b0045..28aae15e9492a 100755 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -1382,7 +1382,7 @@ def get_data(self): d = { "key": series_title, "values": [ - {'x': i, 'y': v} + {'x': str(i), 'y': v} for i, v in ys.iteritems()] } chart_data.append(d)