[druid] Fix, pydruid forced dependency (#8566)

* [druid] Fix, forced pydruid dependency

* [druid] Fix, more type annotation that force pydruid dependency
This commit is contained in:
Daniel Vaz Gaspar 2019-11-15 09:25:23 +00:00 committed by GitHub
parent 71ac788b20
commit efb44ba59d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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 = {"!=": "==", ">=": "<", "<=": ">"}