mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Removing escape_sql so we dont double escape
This commit is contained in:
parent
42ebcaad40
commit
e1af421f0c
@ -432,8 +432,6 @@ class SqlaTable(Model, BaseDatasource):
|
|||||||
from_sql = self.sql
|
from_sql = self.sql
|
||||||
if template_processor:
|
if template_processor:
|
||||||
from_sql = template_processor.process_template(from_sql)
|
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)
|
from_sql = sqlparse.format(from_sql, strip_comments=True)
|
||||||
return TextAsFrom(sa.text(from_sql), []).alias('expr_qry')
|
return TextAsFrom(sa.text(from_sql), []).alias('expr_qry')
|
||||||
return self.get_sqla_table()
|
return self.get_sqla_table()
|
||||||
|
@ -145,11 +145,6 @@ class BaseEngineSpec(object):
|
|||||||
|
|
||||||
BaseEngineSpec.df_to_db(**df_to_db_kwargs)
|
BaseEngineSpec.df_to_db(**df_to_db_kwargs)
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def escape_sql(cls, sql):
|
|
||||||
"""Escapes the raw SQL"""
|
|
||||||
return sql
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def convert_dttm(cls, target_type, dttm):
|
def convert_dttm(cls, target_type, dttm):
|
||||||
return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
|
return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
@ -552,10 +547,6 @@ class PrestoEngineSpec(BaseEngineSpec):
|
|||||||
uri.database = database
|
uri.database = database
|
||||||
return uri
|
return uri
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def escape_sql(cls, sql):
|
|
||||||
return re.sub(r'%%|%', '%%', sql)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def convert_dttm(cls, target_type, dttm):
|
def convert_dttm(cls, target_type, dttm):
|
||||||
tt = target_type.upper()
|
tt = target_type.upper()
|
||||||
|
Loading…
Reference in New Issue
Block a user