You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/02/14 09:28:46 UTC

[GitHub] vnnw commented on a change in pull request #4421: Update core.py

vnnw commented on a change in pull request #4421: Update core.py
URL: https://github.com/apache/incubator-superset/pull/4421#discussion_r168116469
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -1275,13 +1276,44 @@ def filter(self, datasource_type, datasource_id, column):
             return json_error_response(DATASOURCE_MISSING_ERR)
         if not self.datasource_access(datasource):
             return json_error_response(DATASOURCE_ACCESS_ERR)
-
-        payload = json.dumps(
-            datasource.values_for_column(
-                column,
-                config.get('FILTER_SELECT_ROW_LIMIT', 10000),
-            ),
-            default=utils.json_int_dttm_ser)
+        # Implement: Cache endpoint by datasource and column
+        cache_key = hashlib.md5((datasource_id + column).encode('utf-8')).hexdigest()
+        if cache_key and cache:
+            if (hasattr(datasource, 'database') and datasource.database.cache_timeout):
 
 Review comment:
   I don't think using try-except is proper here. There are three possible places to get cache_timeout value. I wanted to make it cascading fallback.

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


With regards,
Apache Git Services