Skip to content

Commit

Permalink
Removing escape_sql so we dont double escape
Browse files Browse the repository at this point in the history
  • Loading branch information
michellethomas committed Mar 9, 2018
1 parent 42ebcaa commit e1af421
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions superset/connectors/sqla/models.py
Expand Up @@ -432,8 +432,6 @@ def get_from_clause(self, template_processor=None, db_engine_spec=None):
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()
Expand Down
9 changes: 0 additions & 9 deletions superset/db_engine_specs.py
Expand Up @@ -145,11 +145,6 @@ def _allowed_file(filename):

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'))
Expand Down Expand Up @@ -552,10 +547,6 @@ def adjust_database_uri(cls, uri, selected_schema=None):
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()
Expand Down

0 comments on commit e1af421

Please sign in to comment.