From efb44ba59d0f94d95ef177d543cf728aae7d0d42 Mon Sep 17 00:00:00 2001 From: Daniel Vaz Gaspar Date: Fri, 15 Nov 2019 09:25:23 +0000 Subject: [PATCH] [druid] Fix, pydruid forced dependency (#8566) * [druid] Fix, forced pydruid dependency * [druid] Fix, more type annotation that force pydruid dependency --- superset/connectors/druid/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index af68f1046a..81653512bf 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -167,7 +167,7 @@ class DruidCluster(Model, AuditMixinNullable, ImportMixin): base_url = self.get_base_url(self.broker_host, self.broker_port) return f"{base_url}/{self.broker_endpoint}" - def get_pydruid_client(self) -> PyDruid: + def get_pydruid_client(self) -> "PyDruid": cli = PyDruid( self.get_base_url(self.broker_host, self.broker_port), self.broker_endpoint ) @@ -829,7 +829,7 @@ class DruidDatasource(Model, BaseDatasource): return granularity @staticmethod - def get_post_agg(mconf: Dict) -> Postaggregator: + def get_post_agg(mconf: Dict) -> "Postaggregator": """ For a metric specified as `postagg` returns the kind of post aggregation for pydruid. @@ -1441,7 +1441,7 @@ class DruidDatasource(Model, BaseDatasource): return (col, extraction_fn) @classmethod - def get_filters(cls, raw_filters, num_cols, columns_dict) -> Filter: + def get_filters(cls, raw_filters, num_cols, columns_dict) -> "Filter": """Given Superset filter data structure, returns pydruid Filter(s)""" filters = None for flt in raw_filters: @@ -1570,7 +1570,7 @@ class DruidDatasource(Model, BaseDatasource): return filters - def _get_having_obj(self, col: str, op: str, eq: str) -> Having: + def _get_having_obj(self, col: str, op: str, eq: str) -> "Having": cond = None if op == "==": if col in self.column_names: @@ -1584,7 +1584,7 @@ class DruidDatasource(Model, BaseDatasource): return cond - def get_having_filters(self, raw_filters: List[Dict]) -> Having: + def get_having_filters(self, raw_filters: List[Dict]) -> "Having": filters = None reversed_op_map = {"!=": "==", ">=": "<", "<=": ">"}