From 85fb4a933d8ab7348082a6849ff96f199b8c02fa Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 7 Jun 2017 22:55:25 -0700 Subject: [PATCH] [hotfix] only apply SQLAlchemy limit where needed Observed issue in dev environment where SQL queries were emitted with `LIMIT 0`. This fix addresses it. --- superset/connectors/sqla/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 38b4a95295..300dd3572f 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -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: