You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/08/05 05:59:09 UTC
(superset) branch experiment/fab-model-class-fix created (now 8e0120533f6)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch experiment/fab-model-class-fix
in repository https://gitbox.apache.org/repos/asf/superset.git
at 8e0120533f6 experiment: test model_class= fix for FSA 3.x break (DO NOT MERGE)
This branch includes the following new commits:
new 8e0120533f6 experiment: test model_class= fix for FSA 3.x break (DO NOT MERGE)
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: experiment: test model_class= fix for FSA 3.x break (DO NOT MERGE)
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch experiment/fab-model-class-fix
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 8e0120533f6513111ad589f71f57522f80b92325
Author: Claude Code <no...@anthropic.com>
AuthorDate: Tue Aug 4 22:58:27 2026 -0700
experiment: test model_class= fix for FSA 3.x break (DO NOT MERGE)
Investigation-only commit for discussion #40273 / PR #42542's revert.
Passes model_class=flask_appbuilder.models.sqla.Model explicitly when
constructing SQLA() in superset/extensions/__init__.py, testing the
theory that FAB's FSA-3.x shim (base.py) leaves Superset's models and
db.session looking at two disconnected declarative registries, since
unlike the FSA-2.x shim (base_legacy.py) it never wires model_class
through.
Local pytest runs against sqlite reproduce neither the break nor a fix
signal (matches PR #42542's original finding that this only surfaced
under real CI). This commit exists to get a real CI signal on
test-sqlite/test-mysql before deciding whether to pursue this as an
actual fix (and whether it needs an upstream flask-appbuilder change
too, or is fixable entirely on Superset's side as this attempts).
---
pyproject.toml | 14 +++++---------
requirements/base.txt | 2 +-
requirements/development.txt | 2 +-
superset/extensions/__init__.py | 4 +++-
4 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 6ea0496b2fc..c480ad4ef3a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -60,15 +60,11 @@ dependencies = [
"flask-login>=0.6.0, < 1.0",
"flask-migrate>=4.1.0, <5.0",
"flask-session>=0.4.0, <1.0",
- # Pinned explicitly below 3.0: 3.0.5 resolves without conflict and
- # supports both SQLAlchemy 1.4 and 2.0, but real CI runs surfaced a
- # structural incompatibility with Superset's current session/app-context
- # handling across Celery task boundaries (see PR #42542) -- widespread
- # "NoneType has no attribute X" failures and MySQL lock-wait timeouts,
- # not just a connection-pool quirk. Needs dedicated investigation, not a
- # driver-compat-prep bump; revisit alongside the actual SQLAlchemy 2.0
- # core bump (discussion #40273, step 6).
- "flask-sqlalchemy>=2.5.1, <3.0",
+ # EXPERIMENTAL: testing whether passing model_class= explicitly when
+ # constructing SQLA() (see superset/extensions/__init__.py) resolves the
+ # PR #42542 regression before committing to a real bump. Do not merge
+ # this pin change as-is.
+ "flask-sqlalchemy>=3.0.5, <3.1",
"flask-wtf>=1.3.0, <2.0",
"geopy",
"greenlet<=3.5.4, >=3.5.4",
diff --git a/requirements/base.txt b/requirements/base.txt
index 78550b9bf8d..9fa8290472c 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -148,7 +148,7 @@ flask-migrate==4.1.0
# via apache-superset (pyproject.toml)
flask-session==0.8.0
# via apache-superset (pyproject.toml)
-flask-sqlalchemy==2.5.1
+flask-sqlalchemy==3.0.5
# via
# apache-superset (pyproject.toml)
# flask-appbuilder
diff --git a/requirements/development.txt b/requirements/development.txt
index b6da9f5fb6a..639925b72c7 100644
--- a/requirements/development.txt
+++ b/requirements/development.txt
@@ -309,7 +309,7 @@ flask-session==0.8.0
# via
# -c requirements/base-constraint.txt
# apache-superset
-flask-sqlalchemy==2.5.1
+flask-sqlalchemy==3.0.5
# via
# -c requirements/base-constraint.txt
# apache-superset
diff --git a/superset/extensions/__init__.py b/superset/extensions/__init__.py
index 35df0900a9b..e43334686ad 100644
--- a/superset/extensions/__init__.py
+++ b/superset/extensions/__init__.py
@@ -154,7 +154,9 @@ async_query_manager: AsyncQueryManager = LocalProxy(
cache_manager = CacheManager()
celery_app = celery.Celery()
csrf = CSRFProtect()
-db = get_sqla_class()()
+from flask_appbuilder.models.sqla import Model as _FABModel # noqa: E402
+
+db = get_sqla_class()(model_class=_FABModel)
# make_versioned() MUST be called immediately after db is constructed and before
# any versioned model class is defined. Continuum patches the SQLAlchemy