mirror of https://github.com/apache/superset.git
Merge pull request #4590 from michellethomas/fixing_double_escape_presto
Removing escape_sql so we dont double escape
This commit is contained in:
commit
4250e239a2
|
@ -432,8 +432,6 @@ class SqlaTable(Model, BaseDatasource):
|
|||
from_sql = self.sql
|
||||
if template_processor:
|
||||
from_sql = template_processor.process_template(from_sql)
|
||||
if db_engine_spec:
|
||||
from_sql = db_engine_spec.escape_sql(from_sql)
|
||||
from_sql = sqlparse.format(from_sql, strip_comments=True)
|
||||
return TextAsFrom(sa.text(from_sql), []).alias('expr_qry')
|
||||
return self.get_sqla_table()
|
||||
|
|
|
@ -146,11 +146,6 @@ class BaseEngineSpec(object):
|
|||
|
||||
BaseEngineSpec.df_to_db(**df_to_db_kwargs)
|
||||
|
||||
@classmethod
|
||||
def escape_sql(cls, sql):
|
||||
"""Escapes the raw SQL"""
|
||||
return sql
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type, dttm):
|
||||
return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
|
@ -553,10 +548,6 @@ class PrestoEngineSpec(BaseEngineSpec):
|
|||
uri.database = database
|
||||
return uri
|
||||
|
||||
@classmethod
|
||||
def escape_sql(cls, sql):
|
||||
return re.sub(r'%%|%', '%%', sql)
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type, dttm):
|
||||
tt = target_type.upper()
|
||||
|
|
Loading…
Reference in New Issue