Compare commits

...
Author SHA1 Message Date
Claude Code 8e0120533f 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).
2026-08-04 22:58:27 -07:00
4 changed files with 10 additions and 12 deletions
+5 -9
View File
@@ -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",
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+3 -1
View File
@@ -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