Skip to content

Commit

Permalink
Increase query limit to 1M, add separate display limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kyryliuk committed Feb 6, 2017
1 parent 0f7189b commit 6f6f7af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@
MAPBOX_API_KEY = ""

# Maximum number of rows returned in the SQL editor
SQL_MAX_ROW = 1000
SQL_MAX_ROW = 1000000
DISPLAY_SQL_MAX_ROW = 1000

# If defined, shows this text in an alert-warning box in the navbar
# one example use case may be "STAGING" to make it clear that this is
Expand Down
11 changes: 7 additions & 4 deletions superset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2481,11 +2481,14 @@ def results(self, key):
if rejected_tables:
return json_error_response(get_datasource_access_error_msg(
'{}'.format(rejected_tables)))

payload = zlib.decompress(blob)
display_limit = app.config.get('DISPLAY_SQL_MAX_ROW', None)
if display_limit:
payload_json = json.loads(payload)
payload_json['data'] = payload_json['data'][:display_limit]
return Response(
zlib.decompress(blob),
status=200,
mimetype="application/json")
json.dumps(payload_json, default=utils.json_iso_dttm_ser),
status=200, mimetype="application/json")
else:
return Response(
json.dumps({
Expand Down

0 comments on commit 6f6f7af

Please sign in to comment.