mistercrunch commented on a change in pull request #7641: [SQL Lab] Clarify SQL 
Lab query and display limits
URL: 
https://github.com/apache/incubator-superset/pull/7641#discussion_r290128034
 
 

 ##########
 File path: superset/views/utils.py
 ##########
 @@ -184,3 +184,10 @@ def get_datasource_info(datasource_id, datasource_type, 
form_data):
             'The datasource associated with this chart no longer exists')
     datasource_id = int(datasource_id)
     return datasource_id, datasource_type
+
+def apply_display_max_row_limit(data):
+    display_limit = app.config.get('DISPLAY_MAX_ROW', None)
+    if display_limit and display_limit < data['query']['rows']:
+        data['data'] = data['data'][:display_limit]
+        data['displayLimitReached'] = True
+    return data
 
 Review comment:
   NIT: CR

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to