Skip to content

Commit

Permalink
[hotfix] druid dist_bar viz issues with non-str x values
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Nov 4, 2016
1 parent 6298707 commit ea18979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ea18979

Please sign in to comment.