Skip to content

Commit

Permalink
Fixing issue #1689
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Nov 28, 2016
1 parent 84e8f74 commit 245c77c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superset/models.py
Expand Up @@ -1063,9 +1063,9 @@ def visit_column(element, compiler, **kw):

dttm_col = cols[granularity]
time_grain = extras.get('time_grain_sqla')
timestamp = dttm_col.get_timestamp_expression(time_grain)

if is_timeseries:
timestamp = dttm_col.get_timestamp_expression(time_grain)
select_exprs += [timestamp]
groupby_exprs += [timestamp]

Expand Down Expand Up @@ -1119,7 +1119,7 @@ def visit_column(element, compiler, **kw):

qry = qry.limit(row_limit)

if timeseries_limit and groupby:
if is_timeseries and timeseries_limit and groupby:
# some sql dialects require for order by expressions
# to also be in the select clause
inner_select_exprs += [main_metric_expr]
Expand Down

0 comments on commit 245c77c

Please sign in to comment.