You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2024/12/19 01:06:27 UTC

(superset) branch rm_lgpl_func_timeout updated (ca24cc4770 -> b2d89c1ee2)

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

maximebeauchemin pushed a change to branch rm_lgpl_func_timeout
in repository https://gitbox.apache.org/repos/asf/superset.git


 discard ca24cc4770 chore: remove dependency on func_timeout because LGPL
     add 88cde7225e chore: deprecate fossa in favor of liccheck to validate python licenses (#31515)
     new b2d89c1ee2 chore: remove dependency on func_timeout because LGPL

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ca24cc4770)
            \
             N -- N -- N   refs/heads/rm_lgpl_func_timeout (b2d89c1ee2)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .asf.yaml                               |  1 +
 .github/workflows/dependency-review.yml | 32 +++++++++++++++++++++++++++++++-
 pyproject.toml                          | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 1 deletion(-)


(superset) 01/01: chore: remove dependency on func_timeout because LGPL

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

maximebeauchemin pushed a commit to branch rm_lgpl_func_timeout
in repository https://gitbox.apache.org/repos/asf/superset.git

commit b2d89c1ee2a1eed010d0af1fbaebff8cd8bf43d9
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Wed Dec 18 10:36:55 2024 -0800

    chore: remove dependency on func_timeout because LGPL
---
 pyproject.toml                                |  2 --
 requirements/base.txt                         |  2 --
 requirements/development.txt                  |  2 +-
 superset/commands/database/test_connection.py | 13 +++++--------
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 176caaf9e5..b8c7b579de 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -53,7 +53,6 @@ dependencies = [
     "flask-migrate>=3.1.0, <4.0",
     "flask-session>=0.4.0, <1.0",
     "flask-wtf>=1.1.0, <2.0",
-    "func_timeout",
     "geopy",
     "greenlet>=3.0.3, <=3.1.1",
     "gunicorn>=22.0.0; sys_platform != 'win32'",
@@ -390,6 +389,5 @@ python-geohash = "0"
 # --------------------------------------------------------------
 
 # TODO REMOVE THESE DEPS FROM CODEBASE
-func-timeout = "4"  # AGPL
 paramiko = "3"  # GPL
 pyxlsb = "1"  # GPL
diff --git a/requirements/base.txt b/requirements/base.txt
index b610aa0e69..771c724c6a 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -145,8 +145,6 @@ flask-wtf==1.2.2
     # via
     #   apache-superset
     #   flask-appbuilder
-func-timeout==4.3.5
-    # via apache-superset
 geographiclib==2.0
     # via geopy
 geopy==2.4.1
diff --git a/requirements/development.txt b/requirements/development.txt
index 41fc32b9e9..09a0002e0a 100644
--- a/requirements/development.txt
+++ b/requirements/development.txt
@@ -8,7 +8,7 @@
 -r base.txt
 -e file:.
     # via
-    #   -r /Users/max/code/superset/requirements/base.in
+    #   -r requirements/base.in
     #   -r requirements/development.in
 build==1.2.1
     # via pip-tools
diff --git a/superset/commands/database/test_connection.py b/superset/commands/database/test_connection.py
index 7330446d47..f0e2b7865b 100644
--- a/superset/commands/database/test_connection.py
+++ b/superset/commands/database/test_connection.py
@@ -21,7 +21,6 @@ from typing import Any, Optional
 
 from flask import current_app as app
 from flask_babel import gettext as _
-from func_timeout import func_timeout, FunctionTimedOut
 from sqlalchemy.engine import Engine
 from sqlalchemy.exc import DBAPIError, NoSuchModuleError
 
@@ -48,6 +47,7 @@ from superset.exceptions import (
 )
 from superset.extensions import event_logger
 from superset.models.core import Database
+from superset.utils import core as utils
 from superset.utils.ssh_tunnel import unmask_password_info
 
 logger = logging.getLogger(__name__)
@@ -142,16 +142,13 @@ class TestConnectionDatabaseCommand(BaseCommand):
 
             with database.get_sqla_engine(override_ssh_tunnel=ssh_tunnel) as engine:
                 try:
-                    alive = func_timeout(
-                        app.config["TEST_DATABASE_CONNECTION_TIMEOUT"].total_seconds(),
-                        ping,
-                        args=(engine,),
-                    )
+                    with utils.timeout(app.config["TEST_DATABASE_CONNECTION_TIMEOUT"]):
+                        alive = ping(engine)
                 except (sqlite3.ProgrammingError, RuntimeError):
-                    # SQLite can't run on a separate thread, so ``func_timeout`` fails
+                    # SQLite can't run on a separate thread, so ``utils.timeout`` fails
                     # RuntimeError catches the equivalent error from duckdb.
                     alive = engine.dialect.do_ping(engine)
-                except FunctionTimedOut as ex:
+                except SupersetTimeoutException as ex:
                     raise SupersetTimeoutException(
                         error_type=SupersetErrorType.CONNECTION_DATABASE_TIMEOUT,
                         message=(