Skip to content

Commit

Permalink
[bug] Fix CSV upload feature for DB with password (apache#4562)
Browse files Browse the repository at this point in the history
* Use sqlalchemy_uri_decrypted in create_engine calls

* Update tox mysql uri

* Include mysql charset=utf8 for py2.7 in tox.ini
  • Loading branch information
ktravis authored and mistercrunch committed Mar 8, 2018
1 parent 6340c9f commit 466812e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _allowed_file(filename):
'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,
Expand Down Expand Up @@ -875,7 +875,7 @@ def get_column_names(filepath):
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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 466812e

Please sign in to comment.