Skip to content

Commit

Permalink
Merge pull request #4590 from michellethomas/fixing_double_escape_presto
Browse files Browse the repository at this point in the history
Removing escape_sql so we dont double escape
  • Loading branch information
john-bodley authored Mar 13, 2018
2 parents 4e494b2 + e1af421 commit 4250e23
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,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 @@ -553,10 +548,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 4250e23

Please sign in to comment.