Escaping the user's SQL in the explore view (#3186)

* Escaping the user's SQL in the explore view

When executing SQL from SQL Lab, we use a lower level API to the
database which doesn't require escaping the SQL. When going through
the explore view, the stack chain leading to the same method may need
escaping depending on how the DBAPI driver is written, and that is the
case for Presto (and perhaps other drivers).

* Using regex to avoid doubling doubles
This commit is contained in:
Maxime Beauchemin
2017-07-27 09:47:31 -07:00
committed by GitHub
parent fb866a937b
commit 25c599d040
3 changed files with 19 additions and 15 deletions

View File

@@ -154,7 +154,6 @@ def execute_sql(ctask, query_id, return_results=True, store_results=False):
template_processor = get_template_processor(
database=database, query=query)
executed_sql = template_processor.process_template(executed_sql)
executed_sql = db_engine_spec.sql_preprocessor(executed_sql)
except Exception as e:
logging.exception(e)
msg = "Template rendering failed: " + utils.error_msg_from_exception(e)