You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2023/06/06 19:48:59 UTC

[superset] branch revert-8b0c68c0d2f2bbf2ddafd8dafe3c4e6cc086a6d1 created (now 948dd97588)

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a change to branch revert-8b0c68c0d2f2bbf2ddafd8dafe3c4e6cc086a6d1
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 948dd97588 revert refactor

This branch includes the following new commits:

     new 948dd97588 revert refactor

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 01/01: revert refactor

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch revert-8b0c68c0d2f2bbf2ddafd8dafe3c4e6cc086a6d1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 948dd97588951a40dffb094ded9685b8e12bf368
Author: hughhhh <hu...@gmail.com>
AuthorDate: Tue Jun 6 15:48:41 2023 -0400

    revert refactor
---
 superset/config.py         | 1 -
 superset/extensions/ssh.py | 9 ++++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/superset/config.py b/superset/config.py
index 434456386d..8444dd638e 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -502,7 +502,6 @@ DEFAULT_FEATURE_FLAGS: dict[str, bool] = {
 # ----------------------------------------------------------------------
 SSH_TUNNEL_MANAGER_CLASS = "superset.extensions.ssh.SSHManager"
 SSH_TUNNEL_LOCAL_BIND_ADDRESS = "127.0.0.1"
-SSH_TUNNEL_TIMEOUT_SEC = 10.0
 
 # Feature flags may also be set via 'SUPERSET_FEATURE_' prefixed environment vars.
 DEFAULT_FEATURE_FLAGS.update(
diff --git a/superset/extensions/ssh.py b/superset/extensions/ssh.py
index 78b0c4116b..6a852ea7cd 100644
--- a/superset/extensions/ssh.py
+++ b/superset/extensions/ssh.py
@@ -20,9 +20,9 @@ import logging
 from io import StringIO
 from typing import TYPE_CHECKING
 
-import sshtunnel
 from flask import Flask
 from paramiko import RSAKey
+from sshtunnel import open_tunnel, SSHTunnelForwarder
 
 from superset.databases.utils import make_url_safe
 
@@ -34,10 +34,9 @@ class SSHManager:
     def __init__(self, app: Flask) -> None:
         super().__init__()
         self.local_bind_address = app.config["SSH_TUNNEL_LOCAL_BIND_ADDRESS"]
-        sshtunnel.TUNNEL_TIMEOUT = app.config["SSH_TUNNEL_TIMEOUT_SEC"]
 
     def build_sqla_url(  # pylint: disable=no-self-use
-        self, sqlalchemy_url: str, server: sshtunnel.SSHTunnelForwarder
+        self, sqlalchemy_url: str, server: SSHTunnelForwarder
     ) -> str:
         # override any ssh tunnel configuration object
         url = make_url_safe(sqlalchemy_url)
@@ -50,7 +49,7 @@ class SSHManager:
         self,
         ssh_tunnel: "SSHTunnel",
         sqlalchemy_database_uri: str,
-    ) -> sshtunnel.SSHTunnelForwarder:
+    ) -> SSHTunnelForwarder:
         url = make_url_safe(sqlalchemy_database_uri)
         params = {
             "ssh_address_or_host": (ssh_tunnel.server_address, ssh_tunnel.server_port),
@@ -69,7 +68,7 @@ class SSHManager:
             )
             params["ssh_pkey"] = private_key
 
-        return sshtunnel.open_tunnel(**params)
+        return open_tunnel(**params)
 
 
 class SSHManagerFactory: