[hotfix] only apply SQLAlchemy limit where needed

Observed issue in dev environment where SQL queries were emitted with
`LIMIT 0`. This fix addresses it.
This commit is contained in:
Maxime Beauchemin 2017-06-07 22:55:25 -07:00
parent d3ace6d63f
commit 85fb4a933d

View File

@ -515,7 +515,8 @@ class SqlaTable(Model, BaseDatasource):
direction = asc if ascending else desc
qry = qry.order_by(direction(col))
qry = qry.limit(row_limit)
if row_limit:
qry = qry.limit(row_limit)
if is_timeseries and \
timeseries_limit and groupby and not time_groupby_inline: