[bug] Fix CSV upload feature for DB with password (#4562)

* Use sqlalchemy_uri_decrypted in create_engine calls

* Update tox mysql uri

* Include mysql charset=utf8 for py2.7 in tox.ini
This commit is contained in:
Kyle Travis
2018-03-07 20:42:52 -05:00
committed by Maxime Beauchemin
parent d494c82930
commit 31a995714d
2 changed files with 3 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ class BaseEngineSpec(object):
'table': table,
'df': df,
'name': form.name.data,
'con': create_engine(form.con.data.sqlalchemy_uri, echo=False),
'con': create_engine(form.con.data.sqlalchemy_uri_decrypted, echo=False),
'schema': form.schema.data,
'if_exists': form.if_exists.data,
'index': form.index.data,
@@ -875,7 +875,7 @@ class HiveEngineSpec(PrestoEngineSpec):
TEXTFILE LOCATION '{location}'
tblproperties ('skip.header.line.count'='1')""".format(**locals())
logging.info(form.con.data)
engine = create_engine(form.con.data.sqlalchemy_uri)
engine = create_engine(form.con.data.sqlalchemy_uri_decrypted)
engine.execute(sql)
@classmethod

View File

@@ -82,7 +82,7 @@ commands =
[testenv:py27-mysql]
basepython = python2.7
setenv =
SUPERSET__SQLALCHEMY_DATABASE_URI = mysql://root@localhost/superset?charset=utf8
SUPERSET__SQLALCHEMY_DATABASE_URI = mysql://mysqluser:mysqluserpassword@localhost/superset?charset=utf8
[testenv:py34-mysql]
basepython = python3.4