You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/09/07 21:47:03 UTC

[GitHub] mistercrunch closed pull request #5830: Get 'Test Connection' button to take 'engine_params' into account

mistercrunch closed pull request #5830: Get 'Test Connection' button to take 'engine_params' into account
URL: https://github.com/apache/incubator-superset/pull/5830
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/templates/superset/models/database/macros.html b/superset/templates/superset/models/database/macros.html
index 32972bc650..da895b3537 100644
--- a/superset/templates/superset/models/database/macros.html
+++ b/superset/templates/superset/models/database/macros.html
@@ -1,7 +1,7 @@
 {% macro testconn() %}
   <script>
     $("#sqlalchemy_uri").parent()
-      .append('<button id="testconn" class="btn">{{ _("Test Connection") }}</button>');
+      .append('<button id="testconn" class="btn btn-sm btn-primary">{{ _("Test Connection") }}</button>');
     $("#testconn").click(function(e) {
       e.preventDefault();
       var url = "/superset/testconn";
diff --git a/superset/views/core.py b/superset/views/core.py
index 97a7da97c5..d21503b7b9 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1701,16 +1701,16 @@ def testconn(self):
                                                                   username),
                 )
 
-            connect_args = (
+            engine_params = (
                 request.json
                 .get('extras', {})
-                .get('engine_params', {})
-                .get('connect_args', {}))
+                .get('engine_params', {}))
+            connect_args = engine_params.get('connect_args')
 
             if configuration:
                 connect_args['configuration'] = configuration
 
-            engine = create_engine(uri, connect_args=connect_args)
+            engine = create_engine(uri, **engine_params)
             engine.connect()
             return json_success(json.dumps(engine.table_names(), indent=4))
         except Exception as e:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org