From 52c5d235af43f659a36ddd0baeece95756395f1b Mon Sep 17 00:00:00 2001 From: Noppanit Charassinvichai Date: Sat, 14 Jan 2017 19:00:34 -0500 Subject: [PATCH] Add analysisTypes to refresh druid (#1983) --- superset/config.py | 1 + superset/models.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/superset/config.py b/superset/config.py index f8771eb28b68b..fff337dd5c719 100644 --- a/superset/config.py +++ b/superset/config.py @@ -77,6 +77,7 @@ # other tz can be overridden by providing a local_config DRUID_IS_ACTIVE = True DRUID_TZ = tz.tzutc() +DRUID_ANALYSIS_TYPES = ['cardinality'] # ---------------------------------------------------- # AUTHENTICATION CONFIG diff --git a/superset/models.py b/superset/models.py index 678564eb4a9ed..ed254a45f214e 100644 --- a/superset/models.py +++ b/superset/models.py @@ -2018,7 +2018,8 @@ def latest_metadata(self): segment_metadata = client.segment_metadata( datasource=self.datasource_name, intervals=lbound + '/' + rbound, - merge=self.merge_flag) + merge=self.merge_flag, + analysisTypes=config.get('DRUID_ANALYSIS_TYPES')) except Exception as e: logging.warning("Failed first attempt to get latest segment") logging.exception(e) @@ -2032,7 +2033,8 @@ def latest_metadata(self): segment_metadata = client.segment_metadata( datasource=self.datasource_name, intervals=lbound + '/' + rbound, - merge=self.merge_flag) + merge=self.merge_flag, + analysisTypes=config.get('DRUID_ANALYSIS_TYPES')) except Exception as e: logging.warning("Failed 2nd attempt to get latest segment") logging.exception(e)