Skip to content

Commit

Permalink
chore: update Druid (#22067)
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Nov 8, 2022
1 parent cdec092 commit 4496748
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pure-eval==0.2.2
# via stack-data
pure-sasl==0.6.2
# via thrift-sasl
pydruid==0.6.2
pydruid==0.6.5
# via apache-superset
pygments==2.12.0
# via ipython
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_git_sha() -> str:
"db2": ["ibm-db-sa>=0.3.5, <0.4"],
"dremio": ["sqlalchemy-dremio>=1.1.5, <1.3"],
"drill": ["sqlalchemy-drill==0.1.dev"],
"druid": ["pydruid>=0.6.1,<0.7"],
"druid": ["pydruid>=0.6.5,<0.7"],
"solr": ["sqlalchemy-solr >= 0.2.0"],
"elasticsearch": ["elasticsearch-dbapi>=0.2.9, <0.3.0"],
"exasol": ["sqlalchemy-exasol >= 2.4.0, <3.0"],
Expand Down
8 changes: 1 addition & 7 deletions superset/db_engine_specs/druid.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from datetime import datetime
from typing import Any, Dict, List, Optional, Type, TYPE_CHECKING

from sqlalchemy import types
from sqlalchemy.engine.reflection import Inspector

from superset import is_feature_enabled
Expand Down Expand Up @@ -131,16 +130,11 @@ def get_columns(
"""
Update the Druid type map.
"""
# pylint: disable=import-outside-toplevel
from pydruid.db.sqlalchemy import type_map

type_map["complex<hllsketch>"] = types.BLOB

return super().get_columns(inspector, table_name, schema)

@classmethod
def get_dbapi_exception_mapping(cls) -> Dict[Type[Exception], Type[Exception]]:
# pylint: disable=import-error,import-outside-toplevel
# pylint: disable=import-outside-toplevel
from requests import exceptions as requests_exceptions

return {
Expand Down
2 changes: 1 addition & 1 deletion superset/db_engine_specs/trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def update_params_from_encrypted_extra(

@classmethod
def get_dbapi_exception_mapping(cls) -> Dict[Type[Exception], Type[Exception]]:
# pylint: disable=import-error,import-outside-toplevel
# pylint: disable=import-outside-toplevel
from requests import exceptions as requests_exceptions

return {
Expand Down
4 changes: 2 additions & 2 deletions superset/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def get_all_table_names_in_schema( # pylint: disable=unused-argument
database=self, inspector=self.inspector, schema=schema
)
return [(table, schema) for table in tables]
except Exception as ex: # pylint: disable=broad-except
except Exception as ex:
raise self.db_engine_spec.get_dbapi_mapped_exception(ex)

@cache_util.memoized_func(
Expand Down Expand Up @@ -593,7 +593,7 @@ def get_all_view_names_in_schema( # pylint: disable=unused-argument
database=self, inspector=self.inspector, schema=schema
)
return [(view, schema) for view in views]
except Exception as ex: # pylint: disable=broad-except
except Exception as ex:
raise self.db_engine_spec.get_dbapi_mapped_exception(ex)

@cache_util.memoized_func(
Expand Down
2 changes: 1 addition & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def request_access(self) -> FlaskResponse:
@has_access
@event_logger.log_this
@expose("/approve", methods=["POST"])
def approve(self) -> FlaskResponse: # pylint: disable=too-many-locals,no-self-use
def approve(self) -> FlaskResponse: # pylint: disable=too-many-locals
def clean_fulfilled_requests(session: Session) -> None:
for dar in session.query(DAR).all():
datasource = DatasourceDAO.get_datasource(
Expand Down

0 comments on commit 4496748

Please sign in to comment.