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)