mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Revert "Preprocess the where clauses." (#2411)
* Revert "Display full name. (#2378)" This reverts commit5b19528662
. * Revert "Preprocess the where clauses. (#2405)" This reverts commit357773c631
.
This commit is contained in:
parent
5b19528662
commit
3107152f5b
@ -517,7 +517,6 @@ class SqlaTable(Model, BaseDatasource):
|
||||
)
|
||||
logging.info(sql)
|
||||
sql = sqlparse.format(sql, reindent=True)
|
||||
sql = self.database.db_engine_spec.sql_preprocessor(sql)
|
||||
return sql
|
||||
|
||||
def query(self, query_obj):
|
||||
|
@ -115,9 +115,9 @@ class BaseEngineSpec(object):
|
||||
def sql_preprocessor(cls, sql):
|
||||
"""If the SQL needs to be altered prior to running it
|
||||
|
||||
For example db api needs to double `%` characters
|
||||
For example Presto needs to double `%` characters
|
||||
"""
|
||||
return sql.replace('%', '%%')
|
||||
return sql
|
||||
|
||||
@classmethod
|
||||
def patch(cls):
|
||||
@ -279,6 +279,10 @@ class PrestoEngineSpec(BaseEngineSpec):
|
||||
from superset.db_engines import presto as patched_presto
|
||||
presto.Cursor.cancel = patched_presto.cancel
|
||||
|
||||
@classmethod
|
||||
def sql_preprocessor(cls, sql):
|
||||
return sql.replace('%', '%%')
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type, dttm):
|
||||
tt = target_type.upper()
|
||||
|
Loading…
Reference in New Issue
Block a user