From 4917ea8ce44c7a8e434a2a49258b19df0be10081 Mon Sep 17 00:00:00 2001 From: Kyle Travis Date: Tue, 6 Mar 2018 18:18:00 +0000 Subject: [PATCH 1/3] Use sqlalchemy_uri_decrypted in create_engine calls --- superset/db_engine_specs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 6c21206a3cb49..73f867729352b 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -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, @@ -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 From 4cc2fb81b518a1d52fbdd69f18bd3392f0e0adf8 Mon Sep 17 00:00:00 2001 From: Kyle Travis Date: Wed, 7 Mar 2018 16:38:56 +0000 Subject: [PATCH 2/3] Update tox mysql uri --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index efdb8aba74f74..96af5c8bccc17 100644 --- a/tox.ini +++ b/tox.ini @@ -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 [testenv:py34-mysql] basepython = python3.4 From 63ea6e46316bb8cf8c474a0bf68150b222789cb4 Mon Sep 17 00:00:00 2001 From: Kyle Travis Date: Wed, 7 Mar 2018 18:05:43 +0000 Subject: [PATCH 3/3] Include mysql charset=utf8 for py2.7 in tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 96af5c8bccc17..8f226c67c45f4 100644 --- a/tox.ini +++ b/tox.ini @@ -82,7 +82,7 @@ commands = [testenv:py27-mysql] basepython = python2.7 setenv = - SUPERSET__SQLALCHEMY_DATABASE_URI = mysql://mysqluser:mysqluserpassword@localhost/superset + SUPERSET__SQLALCHEMY_DATABASE_URI = mysql://mysqluser:mysqluserpassword@localhost/superset?charset=utf8 [testenv:py34-mysql] basepython = python3.4