Skip to content

Commit

Permalink
Revert "Preprocess the where clauses." (#2411)
Browse files Browse the repository at this point in the history
* Revert "Display full name. (#2378)"

This reverts commit 5b19528.

* Revert "Preprocess the where clauses. (#2405)"

This reverts commit 357773c.
  • Loading branch information
bkyryliuk authored Mar 14, 2017
1 parent 5b19528 commit 3107152
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ def visit_column(element, compiler, **kw):
)
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):
Expand Down
8 changes: 6 additions & 2 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def extract_error_message(cls, e):
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):
Expand Down Expand Up @@ -279,6 +279,10 @@ def patch(cls):
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()
Expand Down

0 comments on commit 3107152

Please sign in to comment.